/* Two-column auth (register + login) — mirrors design isRegister / isLogin */

.mn-auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-wrap: wrap; }

.mn-auth-rail {
    flex: 1 1 440px;
    min-width: min(100%, 440px);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    background: radial-gradient(120% 80% at 20% -10%, var(--navy-1) 0%, var(--navy-2) 42%, var(--navy-4) 100%);
    padding: clamp(40px, 4vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fffdf8;
    min-height: 400px;
}
.mn-auth-back {
    display: inline-flex; align-items: center; gap: 9px; align-self: flex-start;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px; padding: 9px 15px; color: #fffdf8; font-size: 14px; font-weight: 700;
    position: relative; z-index: 2;
}
.mn-auth-back:active { transform: scale(.96); }
.mn-auth-rail > div { position: relative; z-index: 2; }
.mn-auth-rail-brand { display: inline-flex; align-items: center; gap: 9px; }
.mn-auth-rail-brand .mn-brand-name { color: #fffdf8; font-weight: 800; font-size: 32px; letter-spacing: normal; }
.mn-auth-rail-brand .mn-brand-mark { font-size: 16px; }
.mn-auth-rail-brand .mn-brand-logo { height: 46px; width: 46px; }
.mn-auth-rail h2 { font-size: clamp(30px, 3vw, 44px); line-height: 1.08; color: #fffdf8; margin: 20px 0 0; }
.mn-auth-login .mn-auth-rail h2 { font-size: clamp(32px, 3.2vw, 48px); line-height: 1.06; }
.mn-auth-rail p { color: rgba(255, 253, 248, .7); font-size: 16px; line-height: 1.55; margin: 18px 0 0; width: 100% }

.mn-auth-steps { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; width: min(100%, 620px); max-width: 620px; }
.mn-auth-step { display: flex; gap: 13px; align-items: flex-start; margin-top: 10px; width: 100%;}
.mn-auth-step-num {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: rgba(246, 179, 63, .16); color: var(--accent); font-family: var(--font-display); font-size: 18px;
}
.mn-auth-step p { flex: 1 1 auto; min-width: 0; max-width: none; width: 100%; margin: 0; font-size: 17.5px; color: rgba(255, 253, 248, .82); line-height: 1.5; padding-top: 4px; }
.mn-auth-step strong { color: #fffdf8; font-weight: 700; }
.mn-auth-step strong::after { content: " — "; font-weight: 400; color: rgba(255, 253, 248, .82); }
.mn-auth-rail-trust {
    display: flex; align-items: center; gap: 9px; position: relative; z-index: 2;
    color: rgba(255, 253, 248, .5); font-size: 13px; font-weight: 600;
}

.mn-auth-form-panel {
    flex: 1 1 480px;
    min-width: min(100%, 420px);
    box-sizing: border-box;
    background: radial-gradient(110% 50% at 90% 4%, #e9f0e8 0, transparent 34%), var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 5vw, 72px) clamp(22px, 4vw, 56px);
}
.mn-auth-login .mn-auth-form-panel { background: radial-gradient(110% 50% at 90% 4%, #f8ead5 0, transparent 34%), var(--cream); }
.mn-auth-form-inner { width: 100%; max-width: 460px; }
.mn-auth-login .mn-auth-form-inner { max-width: 420px; }
.mn-auth-form-inner h1 { font-size: clamp(34px, 3.4vw, 44px); color: var(--navy-3); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 6px; }
.mn-auth-login .mn-auth-form-inner h1 { font-size: clamp(36px, 3.6vw, 48px); line-height: 1.03; }
.mn-auth-form-inner > p.mn-lead { color: var(--muted); font-size: 17px; line-height: 1.5; margin: 0 0 30px; }
.mn-auth-login .mn-auth-form-inner > p.mn-lead { margin: 0 0 32px; }

.mn-auth-form-inner form { display: flex; flex-direction: column; }
.mn-auth-form-inner .mn-field { margin-bottom: 18px; }
.mn-field-hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }

.mn-field label { font-size: 19px; }
/* Forgot? link inline with password label */
.mn-field-label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.mn-field-label-row label { margin-bottom: 0; }
.mn-forgot { font-size: 16px; font-weight: 700; color: var(--navy-3); cursor: pointer; text-decoration: none; }

.mn-lang-group { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.mn-lang-group::-webkit-scrollbar { display: none; }
.mn-lang-option {font-size: 16px;
    flex: 0 0 auto; width: 98px; height: 48px; border-radius: 18px; border: 1.5px solid var(--border);
    background: var(--off-white); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    cursor: pointer; transition: all .2s cubic-bezier(.16, 1, .3, 1); text-align: center;
}
.mn-lang-option.is-selected { border-color: var(--navy-3); background: #eef1f8; transform: scale(1.05); box-shadow: 0 10px 24px rgba(9, 43, 130, .12); }
.mn-lang-option .mn-lang-native { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.1; white-space: nowrap; }
.mn-lang-option .mn-lang-en { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.mn-auth-submit { margin-top: 28px; height: 58px; }
.mn-auth-note { margin-top: 16px; text-align: center; font-size: 16px; color: var(--muted); }
.mn-auth-note a { color: var(--navy-3); font-weight: 800; }
.mn-checkbox-row .mn-check-label { font-size: 16px !important; }

/* Register: tighter vertical rhythm so the form fits inside one screen
   without scrolling (login keeps its own spacing via .mn-auth-login). */
.mn-auth:not(.mn-auth-login) .mn-auth-form-panel {
    padding-top: clamp(16px, 2vw, 26px);
    padding-bottom: clamp(16px, 2vw, 26px);
}
.mn-auth:not(.mn-auth-login) .mn-auth-form-inner h1 { font-size: clamp(28px, 2.8vw, 36px); margin-bottom: 4px; }
.mn-auth:not(.mn-auth-login) .mn-auth-form-inner > p.mn-lead { font-size: 14.5px; margin-bottom: 14px; }
.mn-auth:not(.mn-auth-login) .mn-auth-form-inner .mn-field { margin-bottom: 10px; }
.mn-auth:not(.mn-auth-login) .mn-field label { font-size: 15px; margin-bottom: 4px; }
.mn-auth:not(.mn-auth-login) .mn-field input[type=text],
.mn-auth:not(.mn-auth-login) .mn-field input[type=email],
.mn-auth:not(.mn-auth-login) .mn-field input[type=password],
.mn-auth:not(.mn-auth-login) .mn-field input[type=date] { height: 42px; font-size: 15px; }
.mn-auth:not(.mn-auth-login) .mn-field-hint { font-size: 12px; margin-top: 3px; }
.mn-auth:not(.mn-auth-login) .mn-lang-group { padding: 2px 0 4px; }
.mn-auth:not(.mn-auth-login) .mn-lang-option { height: 38px; }
.mn-auth:not(.mn-auth-login) .mn-lang-option .mn-lang-native { font-size: 15px; }
.mn-auth:not(.mn-auth-login) .mn-checkbox-row .mn-check-label { font-size: 14px !important; }
.mn-auth:not(.mn-auth-login) .mn-auth-submit { margin-top: 12px; height: 46px; }
.mn-auth:not(.mn-auth-login) .mn-auth-note { margin-top: 8px; }

/* Register rail: same "fit one screen" constraint applies to the left panel
   now that it carries one more field's worth of height on the form side. */
.mn-auth:not(.mn-auth-login) .mn-auth-rail { padding: clamp(24px, 2.6vw, 40px); }
.mn-auth:not(.mn-auth-login) .mn-auth-rail-brand .mn-brand-logo { height: 38px; width: 38px; }
.mn-auth:not(.mn-auth-login) .mn-auth-rail-brand .mn-brand-name { font-size: 26px; }
.mn-auth:not(.mn-auth-login) .mn-auth-rail h2 { font-size: clamp(24px, 2.4vw, 34px); margin-top: 14px; }
/* Center only when it actually wraps to 2 lines at narrow widths -- left-ragged
   text reads as an accident there, centered reads as deliberate. Left-aligned
   is fine everywhere it fits on one line, so this only kicks in below. */
@media screen and (max-width: 650px) {
    .mn-auth:not(.mn-auth-login) .mn-auth-rail h2 { text-align: center; }
}
.mn-auth:not(.mn-auth-login) .mn-auth-steps { gap: 10px; margin-top: 14px; }
.mn-auth:not(.mn-auth-login) .mn-auth-step { margin-top: 6px; }
.mn-auth:not(.mn-auth-login) .mn-auth-step-num { width: 26px; height: 26px; font-size: 15px; }
.mn-auth:not(.mn-auth-login) .mn-auth-step p { font-size: 15px; line-height: 1.4; padding-top: 2px; }

/* ==========================================================================
   Mobile — compact rail so the form is reached quickly, aligned inputs.
   ========================================================================== */
@media screen and (max-width: 650px) {
    /* .mn-auth's min-height:100dvh forces a viewport-tall flex container; with
       rail and panel wrapped onto separate lines (mobile) and no explicit
       align-content, the default (stretch) inflates each line to fill any
       leftover height. On login especially -- short heading, short form --
       that stretched the rail from ~109px of real content to 306px of empty
       navy, confirmed by direct measurement. flex-start lets each line take
       only the height its own content needs. */
    .mn-auth { align-content: flex-start; }
    .mn-auth-rail {
        padding: 26px 20px 30px;
        min-height: 0;
        gap: 22px;
        position: relative;
    }
    /* Same fix as the ≤430px tier below: Back floats beside the brand instead
       of taking its own row, at every mobile width, not just the narrowest. */
    /* z-index:3, not the base rule's 2 -- .mn-auth-rail > div (the brand/heading
       wrapper) is also z-index:2, and with Back now absolutely positioned out
       of normal flow, equal z-index ties resolve by DOM order, so that wrapper
       (later in the DOM) was painting over Back and swallowing its clicks. */
    .mn-auth-back { position: absolute; top: 26px; right: 20px; margin: 0; padding: 8px 13px; font-size: 13px; z-index: 3; }
    .mn-auth-rail-brand .mn-brand-name { font-size: 22px; }
    .mn-auth-rail-brand .mn-brand-logo { height: 36px; width: 36px; }
    .mn-auth-rail h2 { font-size: 26px; margin-top: 14px; }
    .mn-auth-login .mn-auth-rail h2 { font-size: 27px; }
    .mn-auth-rail p { font-size: 14.5px; margin-top: 10px; }

    .mn-auth-steps { gap: 12px; margin-top: 16px; }
    .mn-auth-step p { font-size: 14.5px; }
    .mn-auth-step-num { width: 26px; height: 26px; font-size: 15px; }
    .mn-auth-rail-trust { font-size: 12px; }

    .mn-auth-form-panel { padding: 30px 20px 40px; }
    .mn-auth-form-inner h1 { font-size: 28px; }
    .mn-auth-login .mn-auth-form-inner h1 { font-size: 29px; }
    .mn-auth-form-inner > p.mn-lead { font-size: 14.5px; margin-bottom: 22px; }
    .mn-auth-login .mn-auth-form-inner > p.mn-lead { margin-bottom: 24px; }

    .mn-field label { font-size: 15px; }
    .mn-field input[type=text], .mn-field input[type=email], .mn-field input[type=password],
    .mn-field input[type=date], .mn-field input[type=time], .mn-field select { height: 50px; font-size: 15px; }
    .mn-forgot { font-size: 14px; }

    .mn-lang-option { width: 84px; height: 44px; }
    .mn-lang-option .mn-lang-native { font-size: 16px; }

    .mn-auth-submit { height: 52px; margin-top: 22px; }
    .mn-auth-note { font-size: 14px; }
    .mn-checkbox-row .mn-check-label { font-size: 14px !important; }
}

@media screen and (max-width: 430px) {
    /* Rail compacted hard so the form reaches the fold quickly on phones. */
    .mn-auth-rail { padding: 18px 18px 20px; gap: 14px; position: relative; }
    /* Back used to sit on its own row above the brand, costing a full row of
       height for a button with no content of its own. Floating it beside the
       brand instead puts both on one line -- same information, less height. */
    .mn-auth-back { position: absolute; top: 18px; right: 18px; margin: 0; padding: 6px 11px; font-size: 12px; z-index: 3; }
    .mn-auth-rail-brand .mn-brand-name { font-size: 19px; }
    .mn-auth-rail-brand .mn-brand-logo { height: 30px; width: 30px; }
    .mn-auth-rail h2 { font-size: 21px; margin-top: 6px; line-height: 1.15; }
    .mn-auth-login .mn-auth-rail h2 { font-size: 22px; }
    .mn-auth-rail p { font-size: 13px; margin-top: 6px; }

    .mn-auth-steps { gap: 2px; margin-top: 5px; }
    .mn-auth-step { margin-top: 0; gap: 10px; }
    .mn-auth-step p {
        /* No line-clamp: this used to force single-line truncation to keep the
           whole rail on one screen with no scrolling. That constraint is gone
           now that the page scrolls correctly -- cutting real, useful copy
           ("Basic birth details help derive simple timing...") down to
           "Basic birth details help deri..." saved a few px of height at the
           cost of looking broken and hiding the actual value proposition. */
        font-size: 12.5px;
        line-height: 1.28;
    }
    .mn-auth-step-num { width: 21px; height: 21px; font-size: 12px; border-radius: 6px; }
    .mn-auth-rail-trust { display: none; }

    .mn-auth-form-panel { padding: 22px 16px 30px; }
}
