.beles-auth {
  --beles-dark: #230911;
  --beles-primary: #9b1839;
  --beles-ink: #2f151a;
  --beles-muted: #705359;
  --beles-line: #ddc9c0;
  --beles-paper: #fff9ee;
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 20% 18%, #69182a 0%, transparent 60%),
    radial-gradient(ellipse at 86% 94%, #4c1527 0%, transparent 54%),
    #220c16;
  color: var(--beles-ink);
  color-scheme: light;
  font: 400 16px/1.45 Outfit, system-ui, sans-serif;
}

.beles-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .92fr);
  width: min(100%, 1080px);
  min-height: 540px;
  overflow: hidden;
  border: 1px solid #ffc89158;
  border-radius: 23px;
  box-shadow: 0 24px 80px #1b0712a8, 0 4px 14px #1b07128c;
}

.beles-auth-brand {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: center;
  min-width: 0;
  padding: clamp(24px, 4.5vh, 42px) 24px 24px;
  background: var(--beles-dark);
}

.beles-auth-brand::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 22%, #270b15e8 0%, #270b1599 32%, transparent 66%),
    linear-gradient(180deg, #220810bd 0%, transparent 57%),
    url("./assets/beles-login-bingo.webp") center 51% / cover no-repeat,
    #541225;
  content: "";
}

.beles-auth-identity {
  display: flex;
  width: min(100%, 480px);
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.beles-auth-logo {
  width: clamp(108px, 12vw, 148px);
  aspect-ratio: 1;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px #120407b8);
}

.beles-auth-wordmark {
  min-width: 0;
  margin: 0;
  color: #fff0d6;
  font-size: clamp(35px, 4.1vw, 51px);
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 13px #260610, 0 1px 4px #260610;
}

.beles-auth-language {
  position: absolute;
  inset-block-start: 20px;
  inset-inline-end: 24px;
  min-height: 42px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #fbd0a269;
  border-radius: 8px;
  background: #350b17;
  color: #fff5e4;
  font-size: 13px;
  font-weight: 600;
}

.beles-auth-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 42px clamp(28px, 4.3vw, 53px);
  background: linear-gradient(145deg, #fffdf7 8%, var(--beles-paper) 88%);
}

.beles-auth-panel::before {
  position: absolute;
  inset: 0 auto 0 -5px;
  width: 10px;
  background: radial-gradient(circle at center, #792340 1.8px, transparent 2.05px) center top / 10px 14px repeat-y;
  content: "";
  pointer-events: none;
}

.beles-auth-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--beles-line);
}

.beles-auth-panel h1 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.beles-auth-switch {
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid #e7c7cf;
  border-radius: 8px;
  background: #fdf0ef;
  color: #8e1735;
  font-size: 13px;
  font-weight: 700;
}

.beles-auth-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.beles-auth-field > label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
}

.beles-auth-input-row {
  position: relative;
}

.beles-auth-input-row input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid #ccb8b5;
  border-radius: 8px;
  background: #fffefe;
  color: var(--beles-ink);
  font: inherit;
}

.beles-auth-input-row input.beles-auth-input-secret {
  padding-inline-end: 76px;
}

.beles-auth-input-row input::placeholder {
  color: #806970;
}

.beles-auth-input-row input[aria-invalid="true"] {
  border-color: var(--beles-primary);
}

.beles-auth-reveal {
  position: absolute;
  inset: 2px 4px 2px auto;
  min-width: 52px;
  padding: 0 8px;
  border-radius: 6px;
  color: #8e1735;
  font-size: 13px;
  font-weight: 700;
}

.beles-auth-text-link {
  min-height: 42px;
  justify-self: end;
  margin-top: -6px;
  padding: 3px 0 3px 8px;
  color: #8e1735;
  font-size: 13px;
  font-weight: 700;
  text-align: end;
}

.beles-auth-submit {
  position: relative;
  display: inline-flex;
  min-height: 49px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 38px;
  border: 1px solid #871732;
  border-radius: 8px;
  background: linear-gradient(112deg, #a62141 0%, #861534 74%);
  box-shadow: inset 0 1px 0 #ffffff30, 0 3px 10px #5f102037;
  color: #fff;
  font: inherit;
  font-weight: 800;
}

.beles-auth-submit[type="submit"]:not(:disabled)::after {
  position: absolute;
  right: 17px;
  width: 7px;
  height: 7px;
  transform: rotate(-45deg);
  border-right: 2px solid #ffe2b9;
  border-bottom: 2px solid #ffe2b9;
  content: "";
}

.beles-auth-submit:disabled {
  opacity: .72;
  cursor: wait;
}

@media (hover: hover) {
  .beles-auth-submit:hover:not(:disabled) {
    background: #7e1330;
  }

  .beles-auth-switch:hover {
    background: #f8e3e7;
  }

  .beles-auth-reveal:hover,
  .beles-auth-text-link:hover {
    text-decoration: underline;
  }
}

.beles-auth :is(button, input, select):focus-visible {
  outline: 2px solid var(--beles-primary);
  outline-offset: 2px;
}

.beles-auth .beles-auth-language:focus-visible {
  outline-color: #ffd993;
}

.beles-auth-error {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #f0bfc9;
  border-radius: 8px;
  background: #fce9ee;
  color: #8c1a35;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.beles-auth-help {
  margin: 0 0 7px;
  color: var(--beles-muted);
}

.beles-auth-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #fffb;
  border-right-color: transparent;
  border-radius: 50%;
  animation: beles-auth-spin .75s linear infinite;
}

@keyframes beles-auth-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .beles-auth-spinner { animation: none; }
}

@media (max-width: 740px) {
  .beles-auth {
    align-items: start;
    padding-block: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-bottom));
  }

  .beles-auth-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 460px;
    min-height: auto;
    border-radius: 17px;
  }

  .beles-auth-brand {
    min-height: clamp(211px, 58vw, 244px);
    padding: 18px 14px 13px;
  }

  .beles-auth-brand::before {
    inset-block-start: 30px;
    background:
      radial-gradient(ellipse at 50% 25%, #230911f0 1%, #23091182 44%, transparent 75%),
      linear-gradient(180deg, var(--beles-dark) 0%, transparent 48%),
      url("./assets/beles-login-bingo.webp") center 72% / cover no-repeat;
  }

  .beles-auth-logo {
    width: clamp(94px, 26vw, 116px);
  }

  .beles-auth-wordmark {
    font-size: clamp(29px, 8vw, 37px);
  }

  .beles-auth-language {
    inset-block-start: 9px;
    inset-inline-end: 9px;
  }

  .beles-auth-panel {
    padding: 19px;
  }

  .beles-auth-panel::before {
    inset: -5px 0 auto;
    width: auto;
    height: 10px;
    background-size: 14px 10px;
    background-repeat: repeat-x;
  }

  .beles-auth-panel-head {
    margin-bottom: 15px;
    padding-bottom: 11px;
  }
}

@media (max-width: 360px) {
  .beles-auth-panel {
    padding: 15px;
  }

  .beles-auth-form {
    gap: 10px;
  }
}
