:root {
  color-scheme: dark;
  --bg: #060911;
  --panel: rgba(13, 19, 32, 0.92);
  --surface: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eef2ff;
  --muted: #8d97ad;
  --mint: #6ef3c5;
  --violet: #a78bfa;
  --danger: #fb7185;
  --warning: #fcd34d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(110, 243, 197, 0.13), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(167, 139, 250, 0.16), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(88, 199, 255, 0.1), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
}

a {
  color: inherit;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 34px 80px -40px rgba(0, 0, 0, 0.95);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.auth-card.is-wide {
  width: min(560px, 100%);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
  text-decoration: none;
}

.auth-brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--mint), #58c7ff 55%, var(--violet));
  transform: rotate(45deg);
  box-shadow: 0 10px 26px -10px rgba(110, 243, 197, 0.7);
}

.auth-brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 3px;
  background: #071019;
}

.auth-brand-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.auth-brand-text em {
  font-style: normal;
  background: linear-gradient(120deg, var(--mint), #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.auth-kicker {
  margin: 0 0 7px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(25px, 5vw, 31px);
  line-height: 1.25;
}

.auth-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: #d9e2f2;
  font-size: 12.5px;
  font-weight: 600;
}

.field-step {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: rgba(110, 243, 197, 0.12);
  color: var(--mint);
  font-size: 11px;
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(110, 243, 197, 0.6);
  background: rgba(255, 255, 255, 0.06);
}

.field select option {
  background: #111827;
  color: var(--text);
}

.bank-picker {
  display: flex;
  gap: 8px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  -webkit-overflow-scrolling: touch;
}

.bank-picker-section {
  display: grid;
  gap: 6px;
}

.bank-picker-section + .bank-picker-section {
  margin-top: 8px;
}

.bank-picker-group-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bank-picker::-webkit-scrollbar {
  height: 4px;
}

.bank-picker::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.bank-option {
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 5px;
  width: 74px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.bank-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.bank-option.is-active {
  border-color: rgba(110, 243, 197, 0.48);
  background: rgba(110, 243, 197, 0.09);
  color: var(--text);
  box-shadow: 0 10px 24px -18px rgba(110, 243, 197, 0.8);
}

.bank-option-name {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-picker-selected {
  margin: 0;
  color: var(--mint);
  font-size: 11.5px;
  font-weight: 600;
}

.bank-picker-loading {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 620px) {
  .bank-picker {
    flex-wrap: wrap;
    overflow: visible;
  }
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.form-note {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(252, 211, 77, 0.22);
  border-radius: 12px;
  background: rgba(252, 211, 77, 0.07);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.65;
}

html.is-referral-link #referralField {
  display: none;
}

#referralLinkNote {
  border-color: rgba(110, 243, 197, 0.22);
  background: rgba(110, 243, 197, 0.07);
  color: var(--mint);
}

#referralLinkCode {
  letter-spacing: 0.04em;
}

.auth-alert {
  padding: 11px 13px;
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 12px;
  background: rgba(251, 113, 133, 0.09);
  color: #fecdd3;
  font-size: 12.5px;
  line-height: 1.6;
}

.auth-alert[hidden] {
  display: none;
}

.auth-submit {
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--mint), #7dd3fc);
  color: #06110d;
  forced-color-adjust: none;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.auth-submit:hover {
  filter: brightness(1.05);
}

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

.auth-switch {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}

.auth-switch a,
.auth-home {
  color: var(--mint);
  font-weight: 700;
  text-decoration: none;
}

.auth-home {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 900px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 20px 12px;
  }

  .auth-card {
    padding: 23px 18px;
    border-radius: 20px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

/* Registration OTP */
.otp-field {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.otp-input-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.otp-input-row input {
  flex: 1;
  min-width: 0;
  height: 46px;
  letter-spacing: 0.24em;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.otp-send-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 126px;
  height: 46px;
  padding: 0 11px;
  border: 1px solid rgba(110, 243, 197, 0.38);
  border-radius: 12px;
  background: rgba(110, 243, 197, 0.08);
  color: var(--mint);
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.otp-send-btn:hover:not(:disabled) {
  border-color: rgba(110, 243, 197, 0.65);
  background: rgba(110, 243, 197, 0.14);
}

.otp-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.otp-note {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.otp-note.is-ok {
  color: var(--mint);
}

.otp-note.is-error {
  color: #fda4af;
}

@media (max-width: 520px) {
  .otp-send-btn {
    min-width: 112px;
    padding: 0 8px;
    font-size: 10.5px;
  }
}

@media (max-width: 360px) {
  .otp-send-btn {
    min-width: 102px;
    font-size: 10px;
  }
}

/* Contact admin from the auth screen */
.auth-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 9px 16px;
  border: 1px solid rgba(110, 243, 197, 0.28);
  border-radius: 999px;
  background: rgba(110, 243, 197, 0.055);
  color: var(--mint);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  align-self: center;
}

.auth-contact:hover {
  border-color: rgba(110, 243, 197, 0.52);
  background: rgba(110, 243, 197, 0.1);
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.78);
  backdrop-filter: blur(5px);
}

.contact-modal-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: 26px 22px 20px;
  border: 1px solid rgba(110, 243, 197, 0.2);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(110, 243, 197, 0.1), transparent 44%),
    #0b1220;
  box-shadow: 0 34px 90px -36px #000;
}

.contact-modal-card h2 {
  margin: 3px 0 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.contact-modal-sub {
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.contact-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.contact-channels {
  display: grid;
  gap: 9px;
}

.contact-channel {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
}

.contact-channel:hover {
  border-color: rgba(110, 243, 197, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.contact-channel-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.contact-channel-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact-channel.is-line {
  border-color: rgba(6, 199, 85, 0.3);
}

.contact-channel.is-telegram {
  border-color: rgba(34, 158, 217, 0.3);
}

.contact-channel-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.contact-channel-copy b {
  font-size: 13px;
}

.contact-channel-copy small {
  color: var(--muted);
  font-size: 10.5px;
}

.contact-channel-arrow {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.contact-status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

body.contact-modal-open {
  overflow: hidden;
}

/* Registration OTP step */
.otp-step {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.otp-step-back {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.otp-step-back:hover {
  color: var(--mint);
}

.otp-step h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.otp-step-sub {
  margin: -3px 0 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.otp-step-sub b {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.otp-code-input {
  width: 100%;
  height: 56px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.otp-code-input:focus {
  border-color: rgba(110, 243, 197, 0.6);
  background: rgba(255, 255, 255, 0.06);
}

.otp-step .auth-submit {
  width: 100%;
  margin-top: 2px;
}

.otp-step .otp-note {
  margin: -2px 0 0;
  text-align: center;
}

.otp-step-links {
  display: flex;
  justify-content: center;
}

.otp-resend {
  padding: 3px 8px;
  border: 0;
  background: none;
  color: var(--mint);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.otp-resend:hover:not(:disabled) {
  text-decoration: underline;
}

.otp-resend:disabled {
  color: var(--muted);
  opacity: 0.72;
  cursor: not-allowed;
}
