/* ========================================================================
   Deposit Statistics — Auth styles
   Scope: .auth-ui  (applied to .auth-modal-inner in all popup files)
   Global: :root vars, .auth-modal* overlay system, body.auth-open, .auth-alert
   ------------------------------------------------------------------------ */

:root {
  --bg:          #F4F1EA;
  --bg-elev:     #FBF9F4;
  --bg-card:     #fff;
  --ink:         #15140F;
  --ink-2:       #4A4639;
  --ink-3:       #8A8472;
  --line:        #E4DECC;
  --line-2:      #EEEADE;
  --line-dark:   #2A2823;
  --ink-mute:    #9C9685;
  --ink-mute-2:  #B0AB9A;
  --c-green:     #2E9D58;
  --c-yellow:    #EABF00;
  --c-blue:      #1F6FE0;
  --c-red:       #CD0E00;
  --c-track:     #ECE6D3;
  --pos:         oklch(0.58 0.13 150);
  --pos-soft:    oklch(0.95 0.04 150);
  --amber:       oklch(0.72 0.13 75);
  --amber-soft:  oklch(0.94 0.05 75);
}

/* ===== Modal overlay — global =========================================== */

.auth-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  visibility: hidden; opacity: 0;
  transition: opacity .22s ease, visibility .22s ease;
}
.auth-modal.is-open { visibility: visible; opacity: 1; }

.auth-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(21,20,15,.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.auth-modal-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1.05fr;
  width: 100%; max-width: 1080px; max-height: 90vh;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.4);
}

.auth-modal-close {
  position: absolute; top: 18px; right: 18px; z-index: 10;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(21,20,15,.06); color: var(--ink);
  display: grid; place-items: center;
  border: 1px solid var(--line); transition: background .15s;
}
.auth-modal-close:hover { background: rgba(21,20,15,.12); }

body.auth-open { overflow: hidden; }

/* ===== Alert banners — global (shown inside modal, scoped only by context) */

.auth-alert {
  border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 1.5;
  margin-bottom: 12px;
}
.auth-alert.error  { background: #fff2f2; border: 1px solid #ffd0d0; color: #b91c1c; }
.auth-alert.success { background: var(--pos-soft); border: 1px solid var(--c-green); color: #166534; }
.auth-alert a { color: inherit; text-decoration: underline; }

/* ===== Scoped to .auth-ui =============================================== */

.auth-ui * { box-sizing: border-box; }
.auth-ui a { color: inherit; text-decoration: none; }
.auth-ui button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ----- Left — editorial brand aside ----- */

.auth-ui .aside {
  background: var(--ink); color: var(--bg);
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; min-height: 0;
}

.auth-ui .brand { display: flex; align-items: center; gap: 14px; }
.auth-ui .brand .logo-mark { display: block; flex: none; }
.auth-ui .brand-type { display: flex; flex-direction: column; line-height: 1; }
.auth-ui .brand-type .b1 {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
  font-size: 20px; letter-spacing: -0.035em; color: var(--bg);
}
.auth-ui .brand-type .b2 {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 500;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-mute); margin-top: 5px;
}

.auth-ui .aside .pitch { position: relative; z-index: 2; }
.auth-ui .aside .eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px;
  border: 1px solid var(--line-dark); border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink-mute-2);
  background: transparent; margin-bottom: 28px;
}
.auth-ui .aside .eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-yellow);
  box-shadow: 0 0 0 3px rgba(234,191,0,.15);
}
.auth-ui .aside h2 {
  font-size: 54px; letter-spacing: -0.025em; line-height: 1.02; margin: 0; color: var(--bg);
}
.auth-ui .aside h2 em { font-style: italic; color: var(--ink-mute); font-weight: 500; }
.auth-ui .aside .lede {
  font-size: 15px; line-height: 1.55; color: var(--ink-mute-2);
  margin: 20px 0 0; max-width: 380px;
}

.auth-ui .aside .stats {
  display: flex; flex-direction: column; gap: 10px; margin-top: 36px; max-width: 380px;
}
.auth-ui .aside .stat {
  background: rgba(255,255,255,.04); border: 1px solid var(--line-dark); border-radius: 12px;
  padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 18px;
}
.auth-ui .aside .stat .k {
  font-size: 11px; color: var(--ink-mute); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
}
.auth-ui .aside .stat .v {
  font-family: 'Space Grotesk', sans-serif; font-feature-settings: "tnum" 1;
  font-size: 20px; font-weight: 600; color: var(--bg);
}
.auth-ui .aside .stat .v.amber { color: var(--c-yellow); }

.auth-ui .aside .legal {
  font-size: 12px; color: var(--ink-mute);
  display: flex; justify-content: space-between; gap: 18px;
  position: relative; z-index: 2;
}
.auth-ui .aside .legal a {
  color: var(--ink-mute-2); text-decoration: underline;
  text-decoration-color: var(--line-dark); text-underline-offset: 3px;
}

.auth-ui .aside .chart {
  position: absolute; right: -40px; bottom: 130px; opacity: .18; pointer-events: none;
}

/* ----- Right — form column ----- */

.auth-ui .form-col {
  padding: 56px 64px; display: flex; flex-direction: column; justify-content: center;
  background: var(--bg); position: relative; overflow: auto;
}
.auth-ui .form-col .topbar {
  position: absolute; top: 32px; left: 64px; right: 64px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--ink-3);
}
.auth-ui .form-col .topbar a {
  color: var(--ink); font-weight: 600;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
}
.auth-ui .form-col .topbar a:hover { border-color: var(--ink); }

.auth-ui .card { max-width: 440px; width: 100%; margin: 0 auto; }
.auth-ui .card .kicker {
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 600;
  color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.auth-ui .card .kicker::before { content: ""; width: 24px; height: 1px; background: var(--ink-3); display: block; }
.auth-ui .card h1 {
  font-size: 54px; letter-spacing: -0.025em; line-height: 1; margin: 0 0 18px;
}
.auth-ui .card h1 em { font-style: italic; color: var(--ink-3); font-weight: 500; }
.auth-ui .card .sub { font-size: 15px; color: var(--ink-2); line-height: 1.55; margin: 0 0 36px; max-width: 400px; }
.auth-ui .card .sub b { color: var(--ink); font-weight: 600; }

/* ----- Form fields ----- */

.auth-ui .form { display: flex; flex-direction: column; gap: 18px; }
.auth-ui .field { display: flex; flex-direction: column; gap: 7px; }
.auth-ui .field label {
  font-size: 12px; color: var(--ink-3); font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  display: flex; justify-content: space-between;
}
.auth-ui .field label a {
  font-size: 12px; color: var(--ink); text-transform: none; letter-spacing: 0;
  border-bottom: 1px solid var(--line); padding-bottom: 1px; font-weight: 600;
}
.auth-ui .field label a:hover { border-color: var(--ink); }

.auth-ui .input {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font: 500 15px 'Manrope', sans-serif; color: var(--ink);
  outline: none; transition: border-color .15s ease, background .15s ease;
  width: 100%;
}
.auth-ui .input::placeholder { color: var(--ink-3); font-weight: 400; }
.auth-ui .input:focus { border-color: var(--ink); background: #fff; }
.auth-ui .input.with-icon { padding-left: 44px; }

.auth-ui .input-wrap { position: relative; display: flex; flex-direction: column; }
.auth-ui .input-wrap .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
}
.auth-ui .input-wrap .reveal {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--ink-3); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-card);
}
.auth-ui .input-wrap .reveal:hover { color: var(--ink); border-color: var(--ink-3); }

.auth-ui .row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: -2px; }
.auth-ui .check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.auth-ui .check input {
  appearance: none; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg-card); display: grid; place-items: center; cursor: pointer; margin: 0; flex: none;
}
.auth-ui .check input:checked { background: var(--ink); border-color: var(--ink); }
.auth-ui .check input:checked::after {
  content: ""; width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23F4F1EA' stroke-width='4'%3E%3Cpath d='M5 12l5 5 9-11'/%3E%3C/svg%3E") center/contain no-repeat;
}
.auth-ui .check b { color: var(--ink); font-weight: 600; }
.auth-ui .check a { color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 1px; font-weight: 600; }

.auth-ui .submit {
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 10px;
  padding: 15px 22px; font: 600 15px 'Manrope', sans-serif; letter-spacing: -0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; transition: background .15s ease; margin-top: 6px;
}
.auth-ui .submit:hover { background: #000; }
.auth-ui .submit .arrow { font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 17px; transition: transform .2s ease; }
.auth-ui .submit:hover .arrow { transform: translateX(3px); }

.auth-ui .divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink-3); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; margin: 24px 0 4px;
}
.auth-ui .divider::before,
.auth-ui .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-ui .oauth { display: grid; grid-template-columns: 1fr; gap: 10px; }
.auth-ui .oauth .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px;
  font: 600 14px 'Manrope', sans-serif; color: var(--ink);
  background: var(--bg-card); border: 1px solid var(--line); cursor: pointer;
}
.auth-ui .oauth .btn:hover { border-color: var(--ink-3); }
.auth-ui .oauth .btn svg { flex: none; }

.auth-ui .foot { font-size: 13px; color: var(--ink-3); margin-top: 32px; text-align: center; }
.auth-ui .foot a { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.auth-ui .foot a:hover { border-color: var(--ink); }

/* ----- Steps pill row ----- */

.auth-ui .steps {
  display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.auth-ui .steps .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev);
}
.auth-ui .steps .pill .n {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-card); color: var(--ink-3); font-size: 10px; border: 1px solid var(--line);
}
.auth-ui .steps .pill.on  { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.auth-ui .steps .pill.on .n { background: var(--c-yellow); color: var(--ink); border-color: var(--c-yellow); }
.auth-ui .steps .pill.done { color: var(--ink); background: var(--bg-card); }
.auth-ui .steps .pill.done .n { background: var(--pos-soft); color: var(--pos); border-color: var(--pos-soft); }
.auth-ui .steps .line { flex: 0 0 18px; height: 1px; background: var(--line); }

/* ----- OTP code input ----- */

.auth-ui .otp { display: flex; gap: 10px; justify-content: space-between; }
.auth-ui .otp input {
  flex: 1; aspect-ratio: 1/1.05; max-width: 64px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px;
  font-family: 'Playfair Display', serif; font-weight: 500; font-size: 34px;
  letter-spacing: -0.02em; text-align: center; color: var(--ink); outline: none;
  font-feature-settings: "tnum" 1;
  -moz-appearance: textfield;
}
.auth-ui .otp input::-webkit-outer-spin-button,
.auth-ui .otp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.auth-ui .otp input:focus  { border-color: var(--ink); background: #fff; }
.auth-ui .otp input.filled { background: #fff; border-color: var(--ink-3); }

.auth-ui .resend {
  display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
  font-size: 13px; color: var(--ink-3);
}
.auth-ui .resend .timer {
  font-family: 'Space Grotesk', sans-serif; font-feature-settings: "tnum" 1;
  color: var(--ink); font-weight: 600;
}
.auth-ui .resend a { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.auth-ui .resend a.disabled { color: var(--ink-3); border-color: transparent; pointer-events: none; }

/* ----- Password strength meter ----- */

.auth-ui .meter { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.auth-ui .meter .bars { display: flex; gap: 4px; }
.auth-ui .meter .bars i { flex: 1; height: 3px; background: var(--line); border-radius: 2px; }
.auth-ui .meter .bars i.on    { background: var(--ink); }
.auth-ui .meter .bars i.amber { background: var(--c-yellow); }
.auth-ui .meter .bars i.pos   { background: var(--c-green); }
.auth-ui .meter .bars i.red   { background: var(--c-red); }
.auth-ui .meter .label { font-size: 11px; color: var(--ink-3); font-weight: 500; display: flex; justify-content: space-between; }
.auth-ui .meter .label b { font-family: 'Space Grotesk', sans-serif; letter-spacing: .04em; text-transform: uppercase; font-size: 10px; }
.auth-ui .meter .label b.amber { color: var(--c-yellow); }
.auth-ui .meter .label b.pos   { color: var(--c-green); }
.auth-ui .meter .label b.red   { color: var(--c-red); }

.auth-ui .rules {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px;
  margin-top: 10px; font-size: 12px; color: var(--ink-3);
}
.auth-ui .rules .r { display: flex; align-items: center; gap: 8px; }
.auth-ui .rules .r .tick {
  width: 14px; height: 14px; border-radius: 50%; background: var(--line-2); color: var(--ink-3);
  display: inline-grid; place-items: center; flex: none;
}
.auth-ui .rules .r.ok { color: var(--ink-2); }
.auth-ui .rules .r.ok .tick { background: var(--pos-soft); color: var(--c-green); }

/* ----- Email info banner ----- */

.auth-ui .banner {
  border: 1px dashed var(--line); background: var(--bg-elev); border-radius: 12px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--ink-2); margin-top: 4px;
}
.auth-ui .banner .ico {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--amber-soft); color: var(--amber);
  display: grid; place-items: center; flex: none;
}
.auth-ui .banner b { color: var(--ink); font-family: 'Space Grotesk', sans-serif; font-feature-settings: "tnum" 1; }

/* ----- Helpers ----- */

.auth-ui .muted { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin-top: -4px; }
.auth-ui .muted code {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--bg-elev); padding: 1px 6px; border-radius: 4px; color: var(--ink);
}

/* ----- Field error highlight ----- */

.auth-ui .field.field-error label { color: #b91c1c; }
.auth-ui .field.field-error .input-wrap { outline: 1.5px solid #fca5a5; border-radius: 12px; }

/* ===== Responsive ======================================================= */

@media (max-width: 960px) {
  .auth-modal { padding: 0; align-items: flex-end; }
  .auth-modal-inner {
    grid-template-columns: 1fr; max-height: 92vh;
    border-radius: 20px 20px 0 0; max-width: 100%;
  }
  .auth-ui .aside { display: none; }
  .auth-ui .form-col { padding: 40px 24px; }
  .auth-ui .form-col .topbar { position: static; margin-bottom: 24px; }
  .auth-ui .card h1 { font-size: 40px; }
}

/* ============================================================
   RESPONSIVE — Auth modals
   ============================================================ */
@media (max-width:860px){
  .auth-modal { padding: 0; }
  .auth-modal-inner {
    grid-template-columns: 1fr;
    max-width: 480px;
    max-height: 100vh;
    border-radius: 0;
  }
  /* Hide the editorial brand panel — keep the form on small screens */
  .auth-ui .aside { display: none; }
  .auth-ui .form-col { padding: 64px 28px 40px; }
  .auth-ui .form-col .topbar { left: 28px; right: 28px; top: 24px; }
}
@media (max-width:560px){
  .auth-ui .form-col { padding: 60px 20px 32px; }
  .auth-ui .form-col .topbar { left: 20px; right: 20px; }
  .auth-ui .rules { grid-template-columns: 1fr; }
}
@media (min-width:861px){
  /* On larger phones/tablets keep modal comfortably inset */
  .auth-modal-inner { max-height: 92vh; }
}
