@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700;800&display=swap');
@import url('tokens.css');

/* Variant D auth screens. */
body.auth-page--variant-d {
    background: var(--green-canvas);
    color: var(--text);
    font-family: var(--font-sans);
}

.auth-page--variant-d .auth-container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "form story";
    background: var(--surface);
}

.auth-page--variant-d .auth-form-pane {
    padding: var(--s-2xl) var(--s-xl);
}

.auth-page--variant-d .auth-card {
    width: min(400px, 100%);
}

.auth-card__brand,
.auth-hero__lockup {
    display: flex;
    align-items: center;
    gap: var(--s-sm);
    color: var(--accent-ink);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-card__brand {
    margin-block-end: var(--s-lg);
}

.auth-card__brand img {
    block-size: 34px;
    inline-size: auto;
}

.auth-page--variant-d .auth-title {
    font-size: clamp(28px, 2.5vw, 36px);
}

.auth-page--variant-d .auth-subtitle {
    color: var(--text-2);
    margin-block-end: var(--s-lg);
}

.auth-page--variant-d .auth-form {
    gap: var(--s-md);
}

.auth-page--variant-d .field__label {
    font-size: 13px;
    font-weight: 600;
}

.auth-page--variant-d .field__control {
    border-color: var(--border-2);
    border-radius: var(--r-sm);
    background: var(--surface);
}

.auth-page--variant-d .field__control:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring-strong);
}

.login-password-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-sm);
}

.login-forgot-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.login-forgot-link:hover {
    color: var(--accent-ink);
}

.ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.auth-page--variant-d .auth-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.auth-page--variant-d .auth-message .ico {
    margin-block-start: 2px;
}

.auth-page--variant-d .auth-actions {
    margin-block-start: var(--s-sm);
}

.auth-page--variant-d .auth-actions .btn {
    background: var(--accent);
    border-color: var(--accent);
    border-radius: var(--r-sm);
    box-shadow: var(--e2);
}

.auth-page--variant-d .auth-actions .btn:hover {
    background: var(--purple-600);
    border-color: var(--purple-600);
    box-shadow: var(--e3);
}

.auth-page--variant-d .auth-actions .btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring-strong);
}

.auth-page--variant-d .auth-footer-links {
    margin-block-start: var(--s-lg);
}

.auth-page--variant-d .auth-message--error {
    background: var(--error-50);
    border-color: color-mix(in srgb, var(--error), transparent 60%);
    color: var(--error);
}

.auth-hero {
    grid-area: story;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--s-lg);
    min-height: 100vh;
    overflow: hidden;
    padding: var(--s-3xl) var(--s-2xl);
    background: var(--hero-band);
    color: var(--on-accent);
    /* .auth-container forces direction:ltr so the "form story" grid areas land
       on the correct physical sides — but that also flips this panel's own
       flex cross-axis, pinning the lockup/radar/title to the left edge
       instead of the right. Flip it back for this panel's own content. */
    direction: rtl;
}

.auth-hero::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        radial-gradient(55% 70% at 78% 12%, rgba(230, 224, 255, 0.22), transparent 60%),
        radial-gradient(60% 65% at 88% 100%, rgba(33, 23, 57, 0.5), transparent 70%);
}

.auth-hero > * {
    position: relative;
}

.auth-hero__lockup {
    color: var(--on-accent);
}

.auth-hero__lockup img {
    block-size: 30px;
    inline-size: auto;
    filter: brightness(0) invert(1);
}

.auth-hero__radar {
    position: relative;
    inline-size: 120px;
    block-size: 120px;
}

.auth-hero__radar span {
    position: absolute;
    inset-block-start: 50%;
    left: 50%;
    border: 1.5px solid rgba(230, 224, 255, 0.45);
    border-radius: var(--r-full);
    transform: translate(-50%, -50%);
}

.auth-hero__radar span:nth-child(1) { inline-size: 36px; block-size: 36px; }
.auth-hero__radar span:nth-child(2) {
    inline-size: 72px;
    block-size: 72px;
    opacity: 0.6;
    animation: login-radar-pulse 3s ease-out infinite;
}
.auth-hero__radar span:nth-child(3) {
    inline-size: 120px;
    block-size: 120px;
    opacity: 0.32;
    animation: login-radar-pulse 3s ease-out infinite 0.8s;
}
.auth-hero__radar span:nth-child(4) {
    inline-size: 10px;
    block-size: 10px;
    border: 0;
    background: var(--on-accent);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.auth-hero__title {
    max-inline-size: 14ch;
    margin: 0;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 700;
    line-height: 1.25;
    direction: rtl;
    text-align: right;
}

.auth-hero__text {
    max-inline-size: 34ch;
    margin: 0;
    color: var(--purple-100);
    font-size: 15px;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

@keyframes login-radar-pulse {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.7); }
    70% { opacity: 0.12; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

@media (max-width: 860px) {
    .auth-page--variant-d .auth-container {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas: "story" "form";
    }

    .auth-page--variant-d .auth-form-pane {
        min-height: auto;
        padding: var(--s-lg);
    }

    .auth-page--variant-d .auth-card__brand {
        display: none;
    }

    .auth-hero {
        display: flex;
        min-height: 170px;
        padding: var(--s-xl) var(--s-lg);
        gap: var(--s-md);
    }

    .auth-hero__radar {
        inline-size: 64px;
        block-size: 64px;
    }

    .auth-hero__radar span:nth-child(2) { inline-size: 46px; block-size: 46px; }
    .auth-hero__radar span:nth-child(3) { inline-size: 64px; block-size: 64px; }
    .auth-hero__title { max-inline-size: none; font-size: 19px; }
    .auth-hero__text { display: none; }
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    margin-block-start: var(--s-lg);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
}

.auth-back-link:hover {
    color: var(--accent-ink);
}

.auth-back-link:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring-strong);
}

.auth-back-link svg {
    inline-size: 16px;
    block-size: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
}

.otp-field { border: 0; display: flex; flex-direction: column; gap: 6px; margin: 0; min-inline-size: 0; padding: 0; }
.otp-field > legend { color: var(--text); font-size: 13px; font-weight: 600; padding: 0; }
.otp-boxes { display: flex; direction: ltr; gap: var(--s-sm); }
.otp-box { block-size: 52px; border: 1px solid var(--border-2); border-radius: var(--r-sm); caret-color: var(--accent); color: var(--text); font-family: var(--font-mono); font-size: 22px; inline-size: 48px; text-align: center; }
.otp-box:focus { border-color: var(--accent); box-shadow: var(--focus-ring-strong); outline: none; }
.otp-box.is-filled { border-color: var(--accent); color: var(--accent-ink); }
.auth-page--variant-d input[name="new_password"],
.auth-page--variant-d input[name="confirm_password"] { direction: ltr; }
