/* ============================================================
   Ravin — Login / Auth experience (self-contained, loads last)
   Premium dark, gold-accent, single centered card.
   ============================================================ */

.ra-auth {
    --ra-bg: #0d0e12;
    --ra-card: rgba(28, 30, 38, .72);
    --ra-card-solid: #1b1d24;
    --ra-line: rgba(255, 255, 255, .09);
    --ra-line-2: rgba(255, 255, 255, .16);
    --ra-tx: #eef0f4;
    --ra-tx-mut: #9aa1ad;
    --ra-tx-dim: #6b7280;
    --ra-gold: #eab308;
    --ra-gold-2: #facc15;
    --ra-gold-soft: rgba(234, 179, 8, .14);
    --ra-gold-line: rgba(234, 179, 8, .42);

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    padding: 2rem 1.15rem;
    background: var(--ra-bg);
    color: var(--ra-tx);
    overflow: hidden;
    font-family: 'Peyda', system-ui, sans-serif;
}

/* ── atmospheric background ── */
.ra-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ra-bg::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 78%);
}
.ra-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.ra-orb-1 { width: 460px; height: 460px; background: radial-gradient(circle, rgba(234, 179, 8, .5), transparent 68%); top: -180px; inset-inline-end: -120px; animation: ra-float-1 16s ease-in-out infinite; }
.ra-orb-2 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(16, 185, 129, .32), transparent 68%); bottom: -170px; inset-inline-start: -120px; animation: ra-float-2 19s ease-in-out infinite; }
@keyframes ra-float-1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-32px, 34px); } }
@keyframes ra-float-2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -28px); } }
@media (prefers-reduced-motion: reduce) { .ra-orb { animation: none; } }

/* ── card ── */
.ra-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 428px;
    background: var(--ra-card);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    border: 1px solid var(--ra-line);
    border-radius: 26px;
    padding: 2.4rem 2.1rem 2.1rem;
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ── brand ── */
.ra-brand { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin-bottom: 1.5rem; }
.ra-logo {
    width: 60px; height: 60px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(150deg, #2a2d38, #16171d);
    border: 1px solid var(--ra-gold-line);
    box-shadow: 0 10px 26px -8px rgba(234, 179, 8, .4), inset 0 1px 0 rgba(255, 255, 255, .08);
    position: relative;
}
.ra-logo::after { content: ''; position: absolute; inset: 0; border-radius: 18px; background: radial-gradient(circle at 50% 0%, rgba(234, 179, 8, .3), transparent 70%); }
.ra-logo img { width: 30px; height: 30px; object-fit: contain; position: relative; z-index: 1; }
.ra-brand-name { font-weight: 900; font-size: 1.4rem; letter-spacing: -.02em; }
.ra-brand-tag { font-size: .8rem; color: var(--ra-tx-dim); }

/* ── step indicator ── */
.ra-steps { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: 1.6rem; }
.ra-step { display: flex; align-items: center; gap: .5rem; }
.ra-step-dot {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 800;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--ra-line-2); color: var(--ra-tx-dim);
    transition: all .25s;
}
.ra-step.is-active .ra-step-dot { background: linear-gradient(140deg, var(--ra-gold), var(--ra-gold-2)); border-color: transparent; color: #17181d; box-shadow: 0 6px 16px -4px rgba(234, 179, 8, .5); }
.ra-step.is-done .ra-step-dot { background: var(--ra-gold-soft); border-color: var(--ra-gold-line); color: var(--ra-gold-2); }
.ra-step-line { width: 34px; height: 2px; border-radius: 2px; background: var(--ra-line-2); }
.ra-step.is-done + .ra-step-line, .ra-step-line.is-done { background: var(--ra-gold-line); }

/* ── headings ── */
.ra-head { text-align: center; margin-bottom: 1.5rem; }
.ra-head h1 { font-size: 1.5rem; font-weight: 900; letter-spacing: -.025em; margin: 0 0 .5rem; }
.ra-head p { color: var(--ra-tx-mut); font-size: .9rem; line-height: 1.85; margin: 0; }
.ra-head .ra-phone { direction: ltr; display: inline-block; unicode-bidi: embed; color: var(--ra-gold-2); font-weight: 700; }

/* ── back link ── */
.ra-back { display: inline-flex; align-items: center; gap: .35rem; color: var(--ra-tx-mut); font-size: .82rem; font-weight: 600; margin-bottom: 1rem; transition: color .15s; }
.ra-back:hover { color: var(--ra-gold-2); }

/* ── fields ── */
.ra-field { margin-bottom: 1.05rem; }
.ra-field > label { display: block; font-size: .82rem; font-weight: 700; color: var(--ra-tx-mut); margin-bottom: .5rem; }
.ra-input-wrap { position: relative; display: flex; align-items: center; }
.ra-input-wrap > svg { position: absolute; left: 15px; width: 17px; height: 17px; color: var(--ra-tx-dim); pointer-events: none; transition: color .2s; }
.ra-input-wrap:focus-within > svg { color: var(--ra-gold-2); }
.ra-input {
    width: 100%; height: 52px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--ra-line-2);
    border-radius: 14px;
    color: var(--ra-tx);
    font-size: .98rem; font-family: inherit;
    padding: 0 16px;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
/* icon sits on the physical left; text keeps clear of it */
.ra-input-wrap .ra-input { padding-left: 44px; padding-right: 16px; }
.ra-input.has-toggle { padding-right: 46px; }
/* show/hide password toggle (right side) */
.ra-pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: none; background: none; cursor: pointer; color: var(--ra-tx-dim); border-radius: 8px; transition: color .15s, background .15s; }
.ra-pw-toggle:hover { color: var(--ra-tx); background: rgba(255,255,255,.06); }
.ra-pw-toggle.on { color: var(--ra-gold-2); }
.ra-pw-toggle svg { width: 18px; height: 18px; }
.ra-pw-toggle .eye-off { display: none; }
.ra-pw-toggle.on .eye-open { display: none; }
.ra-pw-toggle.on .eye-off { display: block; }
.ra-input::placeholder { color: var(--ra-tx-dim); }
.ra-input:focus { outline: none; border-color: var(--ra-gold); background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 4px rgba(234, 179, 8, .16); }
.ra-input.ltr { direction: ltr; text-align: left; }

/* ── captcha: image on the LEFT, refresh, then the input fills the rest of
   the row (row-reverse keeps the input RTL so the placeholder reads right) ── */
.ra-captcha-row { display: flex; align-items: center; gap: .55rem; justify-content: center; }
.ra-captcha-img { width: 132px; height: 52px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--ra-line-2); background: #23252d; }
.ra-captcha-reload {
    width: 52px; height: 52px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; cursor: pointer;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--ra-line-2); color: var(--ra-tx-mut);
    transition: color .15s, border-color .15s, background .15s;
}
.ra-captcha-reload:hover { color: var(--ra-gold-2); border-color: var(--ra-gold-line); background: var(--ra-gold-soft); }
.ra-captcha-input { width: 100%; margin-top: .65rem; text-align: center; letter-spacing: .1em; font-weight: 600; }
.ra-captcha-input::placeholder { letter-spacing: 0; font-weight: 400; }

/* ── submit ── */
.ra-btn {
    width: 100%; height: 53px; border: none; cursor: pointer;
    border-radius: 14px; margin-top: .4rem;
    font-family: inherit; font-size: 1.02rem; font-weight: 800; color: #17181d;
    background: linear-gradient(135deg, var(--ra-gold-2), var(--ra-gold));
    box-shadow: 0 14px 30px -10px rgba(234, 179, 8, .5);
    transition: transform .16s, filter .16s, box-shadow .16s;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
}
.ra-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.ra-btn:active { transform: translateY(0); }

/* ── secondary action row ── */
.ra-alt { display: flex; align-items: center; justify-content: center; gap: .45rem; margin-top: 1.3rem; font-size: .85rem; color: var(--ra-tx-mut); }
.ra-alt form { margin: 0; }
.ra-link {
    background: none; border: none; cursor: pointer; padding: 0;
    color: var(--ra-gold-2); font-family: inherit; font-size: .85rem; font-weight: 700;
    transition: opacity .15s;
}
.ra-link:hover { opacity: .8; }
.ra-link:disabled { color: var(--ra-tx-dim); cursor: default; }

/* ── OTP boxes ── */
.ra-otp { display: flex; gap: .55rem; justify-content: center; direction: ltr; margin-bottom: 1.3rem; }
.ra-otp-digit {
    width: 52px; height: 60px; text-align: center;
    font-size: 1.5rem; font-weight: 800; color: var(--ra-tx);
    background: rgba(255, 255, 255, .045); border: 1px solid var(--ra-line-2); border-radius: 13px;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.ra-otp-digit:focus { outline: none; border-color: var(--ra-gold); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 4px rgba(234, 179, 8, .16); }

/* ── alerts ── */
.ra-alert { border-radius: 12px; padding: .72rem .95rem; font-size: .85rem; font-weight: 600; margin-bottom: 1.1rem; line-height: 1.7; }
.ra-alert.err { background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .32); color: #fca5a5; }
.ra-alert.ok { background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .32); color: #6ee7b7; }

/* ── trust footer ── */
.ra-trust { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .5rem; color: var(--ra-tx-dim); font-size: .8rem; }
.ra-trust svg { width: 14px; height: 14px; color: var(--ra-gold); }

@media (max-width: 480px) {
    .ra-card { padding: 2rem 1.4rem 1.7rem; border-radius: 22px; }
    .ra-otp-digit { width: 46px; height: 56px; font-size: 1.35rem; }
    .ra-captcha-img { width: 148px; }
}

/* ── two-factor (authenticator) setup + challenge ── */
.ra-qr { display: flex; justify-content: center; margin: 0 auto 1.1rem; padding: 12px; background: #fff; border-radius: 16px; width: max-content; }
.ra-qr svg { display: block; width: 190px; height: 190px; }
.ra-secret { text-align: center; font-size: .78rem; color: var(--ra-tx-dim); margin-bottom: 1.3rem; line-height: 2; }
.ra-secret code { display: inline-block; direction: ltr; font-family: ui-monospace, monospace; font-size: .82rem; letter-spacing: .08em; color: var(--ra-gold-2); background: rgba(255,255,255,.05); border: 1px solid var(--ra-line); padding: .4rem .7rem; border-radius: 8px 0 0 8px; border-inline-end: none; }
.ra-secret-row { display: inline-flex; align-items: stretch; margin-top: .4rem; max-width: 100%; }
.ra-secret-row code { border-radius: 0 8px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-secret-copy { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-family: inherit; font-size: .74rem; font-weight: 700; color: var(--ra-tx-mut); background: rgba(255,255,255,.05); border: 1px solid var(--ra-line); border-radius: 8px 0 0 8px; padding: 0 .7rem; transition: color .15s, border-color .15s; }
.ra-secret-copy:hover { color: var(--ra-gold-2); border-color: var(--ra-gold-line); }
.ra-secret-copy.done { color: var(--ra-gold-2); }
.ra-secret-copy svg { flex-shrink: 0; }
