/* MyBackUp authentication and public-page styles */
:root {
    --navy-950: #0f172a;
    --navy-900: #172033;
    --navy-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --white: #ffffff;
    --green-700: #047857;
    --green-800: #065f46;
    --green-600: #059669;
    --green-100: #d1fae5;
    --red-700: #b91c1c;
    --red-100: #fee2e2;
    --blue-100: #dbeafe;
    --blue-800: #1e40af;
    --focus: #0284c7;
    --radius: 18px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: var(--navy-950);
    background: var(--slate-100);
}

a { color: var(--green-700); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(420px, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    min-height: 100%;
    padding: clamp(32px, 5vw, 72px);
    color: var(--white);
    background:
        radial-gradient(circle at 12% 88%, rgba(5, 150, 105, .23), transparent 30%),
        var(--navy-950);
}

.auth-shell--login,
.auth-shell--register {
    --auth-accent: #b91c1c;
    --auth-accent-strong: #991b1b;
    --auth-accent-focus: #dc2626;
    --auth-accent-soft: #f87171;
    --auth-on-dark: #f8fafc;
    --auth-on-dark-muted: #e2e8f0;
    --focus: #ef4444;
}

:is(.auth-shell--login, .auth-shell--register) .auth-intro {
    background:
        radial-gradient(circle at 12% 88%, rgba(220, 38, 38, .23), transparent 30%),
        var(--navy-950);
}

:is(.auth-shell--login, .auth-shell--register) a,
:is(.auth-shell--login, .auth-shell--register) .eyebrow,
:is(.auth-shell--login, .auth-shell--register) .password-toggle {
    color: var(--auth-accent);
}

:is(.auth-shell--login, .auth-shell--register) .auth-intro .eyebrow {
    color: var(--auth-on-dark-muted);
}

:is(.auth-shell--login, .auth-shell--register) .brand {
    color: var(--auth-on-dark);
}

:is(.auth-shell--login, .auth-shell--register) .brand__mark {
    color: var(--auth-accent-soft);
}

:is(.auth-shell--login, .auth-shell--register) .field input:focus {
    border-color: var(--auth-accent-focus);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .13);
}

:is(.auth-shell--login, .auth-shell--register) .primary-button {
    background: var(--auth-accent);
}

:is(.auth-shell--login, .auth-shell--register) .primary-button:hover {
    background: var(--auth-accent-strong);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    color: inherit;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.02em;
    text-decoration: none;
}

.brand__mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 11px;
    background: rgba(255, 255, 255, .08);
}

.brand__mark svg {
    width: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand--ncia {
    display: block;
    line-height: 0;
}

.brand--ncia .brand__logo {
    display: block;
    width: clamp(190px, 22vw, 280px);
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .2));
}

.brand--dark {
    margin-bottom: 34px;
    color: var(--navy-950);
}

.brand--dark .brand__mark {
    color: var(--green-700);
    border-color: var(--slate-200);
    background: var(--slate-100);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--green-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.auth-intro .eyebrow { color: #6ee7b7; }

.auth-intro h1 {
    max-width: 680px;
    margin: 0;
    font-size: clamp(38px, 5vw, 68px);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -.055em;
}

.auth-intro__copy {
    max-width: 540px;
    margin: 24px 0 0;
    color: var(--slate-300);
    font-size: clamp(16px, 1.5vw, 19px);
}

.auth-intro__foot {
    margin: 0;
    color: #94a3b8;
    font-size: 14px;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: clamp(24px, 6vw, 80px);
    background: var(--white);
}

.auth-card {
    width: min(100%, 430px);
}

.auth-card__head { margin-bottom: 28px; }

.auth-card__head h1,
.auth-card__head h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
    letter-spacing: -.04em;
}

.auth-card__head p:last-child {
    margin: 9px 0 0;
    color: var(--slate-500);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--navy-800);
    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--slate-300);
    border-radius: 10px;
    background: var(--white);
    color: var(--navy-950);
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.field input:hover { border-color: #94a3b8; }

.field input:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .13);
}

.password-control { position: relative; }

.password-control input { padding-right: 52px; }

/* Edge/IE add their own password-reveal button; keep one consistent toggle. */
.password-control input::-ms-reveal,
.password-control input::-ms-clear {
    display: none;
}

.password-toggle {
    display: grid;
    position: absolute;
    top: 2px;
    right: 3px;
    place-items: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--green-700);
    font: inherit;
    cursor: pointer;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle:hover { background: var(--slate-100); }

.password-toggle:focus-visible {
    outline: 2px solid var(--green-600);
    outline-offset: 1px;
}

/* ---- Registration wizard ---- */

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    counter-reset: wizard;
}

.wizard-steps li {
    padding-top: 9px;
    border-top: 3px solid var(--slate-300);
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 700;
}

.wizard-steps li.is-done {
    border-top-color: var(--green-600);
    color: var(--green-700);
}

.wizard-steps li.is-current { color: var(--navy-800); }

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.otp-inputs input {
    padding: 11px 0;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

[data-bounce-hold] {
    display: grid;
    justify-items: center;
    padding: 24px 4px 10px;
    text-align: center;
    color: var(--slate-600);
}

.inbox-loader {
    display: grid;
    min-height: 72px;
    place-items: center;
}

.inbox-loader__message {
    margin: 0;
    color: var(--navy-800);
    font-size: clamp(16px, 2.8vw, 19px);
    font-weight: 750;
    line-height: 1.6;
}

.inbox-loader__word {
    display: inline-block;
    white-space: nowrap;
}

.inbox-loader__char {
    display: inline-block;
    animation: inbox-text-wave 600ms ease-in-out both;
    animation-delay: var(--wave-delay, 0ms);
    will-change: transform, color;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes inbox-text-wave {
    0%, 100% {
        color: var(--slate-500);
        transform: translateY(0);
    }
    50% {
        color: var(--auth-accent, var(--green-700));
        transform: translateY(-5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .inbox-loader__char {
        animation: none;
        will-change: auto;
    }
}

.auth-form--inline {
    margin-top: 14px;
    text-align: center;
}

.link-button {
    padding: 6px 4px;
    border: 0;
    background: none;
    color: var(--green-700);
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    text-decoration: underline;
    cursor: pointer;
}

/* ---- Account summary modal ---- */

.modal-backdrop {
    display: grid;
    position: fixed;
    z-index: 50;
    inset: 0;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
}

.modal-card {
    width: min(430px, 100%);
    padding: 28px 26px;
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}

.modal-card h2 {
    margin: 0 0 6px;
    color: var(--navy-900);
    font-size: 21px;
}

.modal-card .field { margin-bottom: 16px; }

.modal-card .primary-button {
    display: grid;
    width: 100%;
    place-items: center;
    text-decoration: none;
}

.modal-copy {
    margin: 0 0 20px;
    color: var(--slate-600);
    font-size: 14px;
}

.field small {
    color: var(--slate-500);
    font-size: 12px;
}

.primary-button {
    min-height: 50px;
    margin-top: 4px;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--green-700);
    color: var(--white);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: background-color .18s ease, transform .12s ease;
}

.primary-button:hover { background: var(--green-800); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled {
    cursor: wait;
    opacity: .68;
}

.auth-switch {
    margin: 26px 0 0;
    color: var(--slate-600);
    font-size: 14px;
    text-align: center;
}

.auth-switch a { font-weight: 750; }

.alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert--error {
    color: var(--red-700);
    background: var(--red-100);
}

.alert--info {
    color: var(--blue-800);
    background: var(--blue-100);
}

.auth-center {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(circle at 50% 0, rgba(5, 150, 105, .08), transparent 34%),
        var(--slate-100);
}

.auth-card--compact {
    padding: clamp(26px, 5vw, 42px);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .09);
}

.container {
    max-width: 760px;
    margin: 48px auto;
    padding: 32px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    background: var(--white);
}

.bad { color: var(--red-700); }

.btn {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 10px;
    background: var(--green-600);
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 820px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-intro {
        min-height: auto;
        padding: 30px 24px 36px;
    }
    .auth-intro > div { margin-top: 34px; }
    .auth-intro h1 { font-size: clamp(34px, 10vw, 50px); }
    .auth-intro__foot { display: none; }
    .auth-panel {
        min-height: 56vh;
        padding: 40px 24px 52px;
    }
}

@media (max-width: 420px) {
    .auth-intro { padding: 24px 18px 30px; }
    .auth-panel { padding-inline: 18px; }
    .auth-card--compact { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
