/*
 * auth.css — login / signup / reset pages.
 * Mobile: form only, logo on top, fits one screen. Desktop: brand panel left, form right.
 */

.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface-1); }
@media (min-width: 992px) {
  .auth-page { grid-template-columns: minmax(420px, 46%) minmax(0, 1fr); }
}

/* Brand panel (desktop only) */
.auth-brand {
  display: none;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  padding: 3rem clamp(2rem, 4vw, 4rem);
  background:
    radial-gradient(90% 70% at 0% 100%, rgba(var(--brand-primary-rgb), .55) 0%, rgba(var(--brand-primary-rgb), 0) 60%),
    radial-gradient(60% 50% at 100% 0%, rgba(var(--brand-secondary-rgb), .28) 0%, rgba(var(--brand-secondary-rgb), 0) 60%),
    linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 100%);
}
@media (min-width: 992px) {
  .auth-brand { display: flex; flex-direction: column; }
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 60% at 30% 40%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 60% at 30% 40%, #000 20%, transparent 80%);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .brand-logo { color: #ffffff; }
.auth-brand-body { margin-top: auto; margin-bottom: auto; max-width: 30rem; }
.auth-brand h2 { color: #ffffff; font-size: clamp(1.8rem, 2.6vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 1rem; }
.auth-brand p.lead { color: rgba(255, 255, 255, .72); font-size: 1.05rem; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; }
.auth-points li { display: flex; gap: .8rem; align-items: flex-start; color: rgba(255, 255, 255, .86); font-size: .9375rem; }
.auth-points .bi { width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #ffffff; }
.auth-brand-foot { color: rgba(255, 255, 255, .5); font-size: .8125rem; }

/* Form side */
.auth-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1rem, env(safe-area-inset-bottom)); }
@media (min-width: 992px) { .auth-main { padding: 2rem clamp(2rem, 5vw, 5rem); } }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-top .brand-logo img { max-height: 34px; }
@media (min-width: 992px) { .auth-top .brand-logo { visibility: hidden; } }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding: 1.25rem 0; }
.auth-card.auth-card-wide { max-width: 520px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .35rem; }
.auth-card .auth-sub { color: var(--text-muted); font-size: .9375rem; margin-bottom: 1.5rem; }
.auth-card .form-control, .auth-card .form-select { min-height: 48px; }
.auth-card .btn-lg { min-height: 50px; width: 100%; }
.auth-card .mb-field { margin-bottom: .9rem; }
.auth-foot { text-align: center; font-size: .8125rem; color: var(--text-faint); }
.auth-switch { text-align: center; font-size: .9rem; color: var(--text-muted); margin-top: 1.1rem; }
.auth-switch a { font-weight: 600; text-decoration: none; }

/* Compact phones: keep the submit button on the first screen */
@media (max-width: 991.98px) and (max-height: 760px) {
  .auth-card { padding: .5rem 0; }
  .auth-card h1 { font-size: 1.35rem; }
  .auth-card .auth-sub { margin-bottom: 1rem; font-size: .875rem; }
  .auth-card .mb-field { margin-bottom: .65rem; }
  .auth-card .form-label { margin-bottom: .25rem; }
  .auth-card .form-control, .auth-card .form-select { min-height: 44px; padding-top: .45rem; padding-bottom: .45rem; }
  .auth-card .btn-lg { min-height: 46px; }
}

/* Floating labels */
.auth-card .form-floating > .form-control { height: 56px; min-height: 56px; padding-top: 1.55rem; padding-bottom: .45rem; }
.auth-card .form-floating > label { color: var(--text-muted); padding-top: 1rem; font-size: .9rem; }
.auth-card .form-floating > .form-control:focus ~ label,
.auth-card .form-floating > .form-control:not(:placeholder-shown) ~ label { transform: scale(.8) translateY(-.55rem) translateX(.15rem); color: var(--text-muted); }
.auth-card .form-floating > label::after { background: transparent !important; }
.auth-card .form-floating > .form-control[readonly] ~ label::after { background: transparent !important; }
.sponsor-status { font-size: .8125rem; margin-top: .3rem; display: flex; align-items: center; gap: .35rem; min-height: 1.1rem; }
.sponsor-status.is-valid { color: var(--success); }
.sponsor-status.is-invalid { color: var(--danger); }
.phone-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .5rem; }
.phone-row > *, .auth-card .row > *, .auth-card .form-floating, .auth-card .input-group > * { min-width: 0; }
.auth-card input, .auth-card select, .auth-card textarea { max-width: 100%; }
.auth-card { overflow-wrap: anywhere; }
/* Long button labels wrap instead of widening the page on phones */
.auth-card .btn:not(.btn-icon):not(.password-toggle) { white-space: normal; text-align: center; }
.phone-row .form-select { height: 56px; }
.country-btn { display: flex; align-items: center; gap: .4rem; text-align: start; font-weight: 600; color: var(--text-strong); }
.country-flag { font-size: 1.15rem; line-height: 1; }
.country-search { padding-left: 2.4rem; height: 46px; border-radius: var(--radius-pill); }
.country-search-icon { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.country-list { display: flex; flex-direction: column; }
.country-option { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 50px; padding: .55rem .5rem; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text-body); font-size: .9375rem; }
.country-option:hover { background: var(--surface-2); }
.country-option .country-check { visibility: hidden; color: var(--brand-primary-text); }
.country-option.is-selected { color: var(--text-strong); font-weight: 600; }
.country-option.is-selected .country-check { visibility: visible; }
@media (min-width: 576px) { #countrySheet .modal-content { max-height: 70vh; } }
.auth-card .form-check-label { font-size: .8125rem; color: var(--text-muted); }
.success-mark { width: 64px; height: 64px; border-radius: 20px; background: rgba(var(--success-rgb), .12); color: var(--success); display: inline-flex; align-items: center; justify-content: center; font-size: 1.9rem; margin-bottom: 1.25rem; }
.user-id-big { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; color: var(--text-strong); }
@media (max-width: 991.98px) and (max-height: 760px) {
  .auth-card .form-floating > .form-control { height: 52px; min-height: 52px; }
  .phone-row .form-select { height: 52px; }
}

/* Signup success dialog */
.reg-done { position: fixed; inset: 0; z-index: 1060; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: reg-fade .25s ease both; overflow-y: auto; }
.reg-done-card { position: relative; width: 100%; max-width: 400px; margin: auto; padding: 1.75rem 1.4rem 1.4rem; border-radius: 24px; background: var(--surface-1); box-shadow: 0 24px 70px rgba(15, 23, 42, .35); text-align: center; overflow: hidden; animation: reg-pop .45s cubic-bezier(.2, 1.2, .4, 1) both; }
.reg-done-card h1 { font-size: 1.5rem; font-weight: 800; margin: .75rem 0 .25rem; }
.reg-check { width: 76px; height: 76px; display: block; margin: 0 auto; }
.reg-check-circle { stroke: var(--success); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: reg-draw .6s .15s ease-out forwards; fill: rgba(var(--success-rgb), .1); }
.reg-check-tick { stroke: var(--success); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: reg-draw .35s .65s ease-out forwards; }
.reg-details { margin: 0 0 .9rem; text-align: left; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.reg-details > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .9rem; }
.reg-details > div + div { border-top: 1px solid var(--border); }
.reg-details dt { font-size: .8125rem; color: var(--text-muted); font-weight: 500; flex-shrink: 0; }
.reg-details dd { margin: 0; min-width: 0; display: flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--text-strong); }
.reg-icon-btn { width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: .85rem; }
.reg-icon-btn:hover { color: var(--brand-primary-text); border-color: rgba(var(--brand-primary-rgb), .45); }
.reg-mail { font-size: .8125rem; color: var(--text-muted); margin-bottom: 1rem; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.reg-mail .bi { color: var(--success); }
.reg-confetti { position: absolute; inset: 0; pointer-events: none; }
.reg-confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: 0; background: var(--brand-primary); animation: reg-fall 1.8s ease-in forwards; }
.reg-confetti i:nth-child(3n) { background: var(--brand-secondary, #f59e0b); }
.reg-confetti i:nth-child(4n) { background: var(--success); width: 6px; height: 6px; border-radius: 50%; }
.reg-confetti i:nth-child(1) { left: 6%; animation-delay: .2s; } .reg-confetti i:nth-child(2) { left: 14%; animation-delay: .45s; }
.reg-confetti i:nth-child(3) { left: 22%; animation-delay: .3s; } .reg-confetti i:nth-child(4) { left: 30%; animation-delay: .6s; }
.reg-confetti i:nth-child(5) { left: 38%; animation-delay: .25s; } .reg-confetti i:nth-child(6) { left: 46%; animation-delay: .5s; }
.reg-confetti i:nth-child(7) { left: 54%; animation-delay: .35s; } .reg-confetti i:nth-child(8) { left: 62%; animation-delay: .55s; }
.reg-confetti i:nth-child(9) { left: 70%; animation-delay: .2s; } .reg-confetti i:nth-child(10) { left: 78%; animation-delay: .4s; }
.reg-confetti i:nth-child(11) { left: 86%; animation-delay: .3s; } .reg-confetti i:nth-child(12) { left: 93%; animation-delay: .5s; }
.reg-confetti i:nth-child(13) { left: 50%; animation-delay: .7s; } .reg-confetti i:nth-child(14) { left: 18%; animation-delay: .75s; }
@keyframes reg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes reg-pop { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes reg-draw { to { stroke-dashoffset: 0; } }
@keyframes reg-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(420px) rotate(540deg); } }
