/* Auth pages: split layout with brand showcase (desktop) and a focused form column. */

.auth-body {
    --auth-navy: #0d1240;
    --auth-navy-2: #16124a;
    --auth-blue: #1d4fb8;
    --auth-green: #17b169;
    --auth-green-strong: #0f9a59;
    --auth-green-soft: #e7f8ef;
    --auth-ink: #0f172a;
    --auth-text: #334155;
    --auth-muted: #64748b;
    --auth-line: #e2e8f0;
    --auth-line-strong: #cbd5e1;
    --auth-surface: #ffffff;
    --auth-page: #f5f7fb;
    --auth-danger: #dc2626;
    --auth-danger-soft: #fef2f2;
    --auth-radius: 14px;
    --auth-focus: 0 0 0 4px rgba(23, 177, 105, 0.16);

    background: var(--auth-page);
    color: var(--auth-ink);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100svh;
}

/* ---------- Brand showcase ---------- */

.auth-showcase {
    display: none;
    color: #fff;
    background:
        radial-gradient(70% 45% at 100% 0%, rgba(23, 177, 105, 0.14), transparent 70%),
        var(--auth-navy);
}

.auth-showcase__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    max-width: 460px;
    min-height: 100%;
    margin: 0 auto;
    padding: 64px 40px;
}


.auth-showcase__title {
    margin: 0;
    font-size: clamp(30px, 2.6vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.auth-showcase__text {
    margin: -12px 0 0;
    max-width: 440px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 16px;
    line-height: 1.6;
}

/* Illustrative SMS card */
.auth-preview {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 60px rgba(3, 6, 30, 0.35);
    backdrop-filter: blur(10px);
}

.auth-preview__head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.auth-preview__head small,
.auth-preview__code small {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.auth-preview__head strong {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.auth-preview__app {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(23, 177, 105, 0.18);
    color: #5fe0a1;
}

.auth-preview__app svg {
    width: 22px;
    height: 22px;
}

.auth-preview__chip {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(23, 177, 105, 0.2);
    color: #7deab4;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.auth-preview__code {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(3, 7, 32, 0.38);
}

.auth-preview__code strong {
    display: block;
    margin-top: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.auth-preview__next {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.auth-preview__next em {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.55);
    font-style: normal;
}

.auth-preview__pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
}

.auth-preview__pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(251, 191, 36, 0.5);
    animation: auth-pulse 1.8s ease-out infinite;
}

.auth-features {
    display: grid;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-features li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
}

.auth-features__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.08);
    color: #7deab4;
}

.auth-features__icon svg {
    width: 20px;
    height: 20px;
}

.auth-features strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.auth-features p {
    margin: 3px 0 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------- Form column ---------- */

.auth-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    padding: 20px 16px;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-logo {
    display: inline-flex;
    border-radius: 12px;
}

.auth-logo img {
    display: block;
    width: auto;
    height: 36px;
}

.auth-logo .auth-logo__custom {
    height: 56px;
}

.auth-logo__light {
    display: none !important;
}

.auth-logo:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus);
}

.auth-language {
    position: relative;
}

.auth-language summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    background: var(--auth-surface);
    color: var(--auth-text);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-language summary::-webkit-details-marker {
    display: none;
}

.auth-language summary svg {
    width: 18px;
    height: 18px;
    color: var(--auth-muted);
}

.auth-language summary:hover,
.auth-language[open] summary {
    border-color: var(--auth-line-strong);
}

.auth-language summary:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus);
}

.auth-language__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    display: grid;
    gap: 2px;
    min-width: 200px;
    padding: 6px;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    background: var(--auth-surface);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.auth-language__menu form {
    margin: 0;
}

.auth-language__menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--auth-text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.auth-language__menu button span {
    font-size: 18px;
    line-height: 1;
}

.auth-language__menu button strong {
    flex: 1;
    font-weight: 600;
}

.auth-language__menu button i {
    display: inline-flex;
    color: var(--auth-green);
}

.auth-language__menu button i svg {
    width: 16px;
    height: 16px;
}

.auth-language__menu button:hover,
.auth-language__menu button:focus-visible {
    outline: none;
    background: var(--auth-page);
}

.auth-language__menu button.is-active {
    background: var(--auth-green-soft);
    color: var(--auth-ink);
}

.auth-content {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 28px 0;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card__header {
    margin-bottom: 28px;
}

.auth-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--auth-green-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-card__header h2 {
    margin: 0;
    color: var(--auth-ink);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.auth-card__header p {
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.55;
}

.auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 50px;
    border: 1px solid var(--auth-line-strong);
    border-radius: 12px;
    background: var(--auth-surface);
    color: var(--auth-ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-google svg {
    width: 20px;
    height: 20px;
}

.auth-google:hover {
    border-color: #94a3b8;
    background: #fafbfc;
}

.auth-google:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-line);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.auth-field label {
    color: var(--auth-ink);
    font-size: 14px;
    font-weight: 600;
}

.auth-field__link {
    color: var(--auth-green-strong);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.auth-field__link:hover {
    text-decoration: underline;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    display: inline-flex;
    color: var(--auth-muted);
    transform: translateY(-50%);
    pointer-events: none;
    transition: color 0.15s ease;
}

.auth-input-icon svg {
    width: 19px;
    height: 19px;
}

.auth-input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    border: 1px solid var(--auth-line-strong);
    border-radius: 12px;
    background: var(--auth-surface);
    color: var(--auth-ink);
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input--password {
    padding-right: 52px;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input:hover {
    border-color: #94a3b8;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-green);
    box-shadow: var(--auth-focus);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--auth-green-strong);
}

.auth-input.is-invalid {
    border-color: var(--auth-danger);
    background: var(--auth-danger-soft);
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.auth-field.has-error .auth-input-icon {
    color: var(--auth-danger);
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-password-toggle svg {
    width: 19px;
    height: 19px;
}

.auth-password-toggle:hover {
    background: var(--auth-page);
    color: var(--auth-ink);
}

.auth-password-toggle:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus);
}

.auth-field__error {
    margin: 0;
    max-height: 0;
    overflow: hidden;
    color: var(--auth-danger);
    font-size: 13px;
    line-height: 1.45;
    opacity: 0;
    transition: opacity 0.18s ease, max-height 0.18s ease;
}

.auth-field__error.is-visible {
    max-height: 80px;
    opacity: 1;
}

.auth-field__error.is-leaving {
    opacity: 0;
}

/* Submit */
.auth-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    background: var(--auth-navy-2);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(22, 18, 74, 0.22);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit:hover {
    background: #231d6b;
    box-shadow: 0 14px 28px rgba(22, 18, 74, 0.26);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 18, 74, 0.25);
}

.auth-submit:disabled {
    cursor: progress;
}

.auth-submit.is-loading {
    background: #2a2577;
}

.auth-submit.is-loading::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

.auth-switch {
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    text-align: center;
}

.auth-switch a,
.auth-back {
    color: var(--auth-ink);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover,
.auth-back:hover {
    color: var(--auth-green-strong);
}

.auth-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    font-size: 14px;
}

.auth-back svg {
    width: 18px;
    height: 18px;
}

.auth-switch a:focus-visible,
.auth-back:focus-visible,
.auth-field__link:focus-visible {
    outline: none;
    border-radius: 6px;
    box-shadow: var(--auth-focus);
}

.auth-perks {
    display: none;
}

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    color: #94a3b8;
    font-size: 12px;
}

.auth-footer__links {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
}

.auth-footer__links a,
.auth-footer__links button {
    color: inherit;
    font-size: inherit;
    text-decoration: none;
}

.auth-footer__links a:hover,
.auth-footer__links button:hover {
    color: var(--auth-ink);
    text-decoration: underline;
}

.auth-legal-note {
    margin: 16px 0 0;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

.auth-legal-note a {
    color: var(--auth-ink);
    font-weight: 700;
}

/* ---------- Toasts ---------- */

.auth-toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 100;
    display: grid;
    justify-items: end;
    pointer-events: none;
}

.auth-toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 12px;
    width: min(380px, 100%);
    padding: 14px 14px 14px 16px;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    background: var(--auth-surface);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
}

.auth-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.auth-toast__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.auth-toast__icon svg {
    width: 17px;
    height: 17px;
}

.auth-toast--success .auth-toast__icon {
    background: var(--auth-green-soft);
    color: var(--auth-green-strong);
}

.auth-toast--error .auth-toast__icon {
    background: var(--auth-danger-soft);
    color: var(--auth-danger);
}

.auth-toast--info .auth-toast__icon {
    background: #eff6ff;
    color: var(--auth-blue);
}

.auth-toast__body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.auth-toast__body strong {
    color: var(--auth-ink);
    font-size: 14px;
}

.auth-toast__body span {
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.45;
}

.auth-toast__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.auth-toast__close:hover {
    background: var(--auth-page);
    color: var(--auth-ink);
}

/* ---------- Motion ---------- */

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes auth-pulse {
    0% {
        opacity: 0.9;
        transform: scale(0.6);
    }

    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-preview__pulse::after,
    .auth-submit.is-loading::before {
        animation-duration: 2.4s;
    }

    .auth-toast,
    .auth-input,
    .auth-submit {
        transition: none;
    }
}

/* ---------- Breakpoints ---------- */

/* Phones and tablets: brand band on top, form in an elevated card. */
@media (max-width: 1023px) {
    .auth-main {
        padding: 0;
        background:
            radial-gradient(70% 120% at 100% 0%, rgba(23, 177, 105, 0.22), transparent 60%) top / 100% 196px no-repeat,
            linear-gradient(160deg, var(--auth-navy) 0%, var(--auth-navy-2) 100%) top / 100% 196px no-repeat,
            var(--auth-page);
    }

    .auth-topbar {
        padding: 18px 20px 0;
    }

    .auth-logo img {
        height: 30px;
    }

    .auth-logo__dark {
        display: none !important;
    }

    .auth-logo__light {
        display: block !important;
    }

    .auth-logo .auth-logo__custom {
        height: 44px;
        padding: 4px 8px;
        border-radius: 10px;
        background: #fff;
    }

    .auth-language summary {
        min-height: 36px;
        padding: 0 12px;
        border-color: rgba(255, 255, 255, 0.22);
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .auth-language summary svg {
        color: rgba(255, 255, 255, 0.8);
    }

    .auth-language summary:hover,
    .auth-language[open] summary {
        border-color: rgba(255, 255, 255, 0.4);
    }

    .auth-content {
        flex: none;
        align-items: flex-start;
        padding: 28px 16px 0;
    }

    .auth-card {
        max-width: 460px;
        padding: 28px 22px 24px;
        border: 1px solid var(--auth-line);
        border-radius: 20px;
        background: var(--auth-surface);
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.1);
    }

    .auth-card__header {
        margin-bottom: 22px;
    }

    .auth-card__header h2 {
        font-size: 24px;
    }

    .auth-card__header p {
        font-size: 14px;
    }

    .auth-form {
        gap: 16px;
    }

    .auth-switch,
    .auth-back {
        margin-top: 20px;
    }

    .auth-footer {
        margin-top: auto;
        padding: 24px 16px 28px;
    }

    .auth-perks {
        display: grid;
        gap: 16px;
        width: 100%;
        max-width: 460px;
        margin: 28px auto 0;
        padding: 0 22px;
        list-style: none;
    }

    .auth-perks li {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 12px;
        align-items: start;
    }

    .auth-perks__icon {
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        background: var(--auth-green-soft);
        color: var(--auth-green-strong);
    }

    .auth-perks__icon svg {
        width: 18px;
        height: 18px;
    }

    .auth-perks strong {
        display: block;
        color: var(--auth-ink);
        font-size: 14px;
        font-weight: 700;
    }

    .auth-perks p {
        margin: 2px 0 0;
        color: var(--auth-muted);
        font-size: 13px;
        line-height: 1.45;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .auth-content {
        padding-top: 40px;
    }

    .auth-card {
        padding: 36px 36px 32px;
    }
}

@media (min-width: 1024px) {
    .auth-shell {
        grid-template-columns: minmax(420px, 0.95fr) minmax(480px, 1.05fr);
    }

    .auth-showcase {
        display: flex;
    }

    .auth-showcase__inner {
        width: 100%;
    }

    .auth-main {
        padding: 32px 56px;
    }
}

@media (max-width: 420px) {
}

/* ---------- How it works: a plain numbered timeline ---------- */
.auth-steps {
    display: grid;
    margin: 12px 0 0;
    padding: 28px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    list-style: none;
}

.auth-steps li {
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 22px;
}

.auth-steps li:last-child {
    padding-bottom: 0;
}

/* Connector between consecutive step numbers. */
.auth-steps li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 4px;
    left: 14px;
    width: 1px;
    background: rgba(255, 255, 255, 0.16);
}

.auth-steps__num {
    flex: none;
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.auth-steps li:first-child .auth-steps__num {
    border-color: var(--auth-green);
    background: var(--auth-green);
}

.auth-steps strong {
    display: block;
    padding-top: 4px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.auth-steps p {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 14px;
    line-height: 1.55;
}
