/**
 * VAQT Auth Login — Trending split-card layout
 * Brand: #080a52 / #94c974
 * Inspired by organic wave dividers + floating card composition
 */

:root {
    --navy: #080a52;
    --navy-2: #12175f;
    --navy-soft: #2a3078;
    --green: #94c974;
    --green-2: #7db85a;
    --bg: #e8ebf2;
    --surface: #ffffff;
    --ink: #0f1438;
    --muted: #6b7394;
    --line: #d8deeb;
    --danger: #c0392b;
    --radius-card: 22px;
    --font: "Plus Jakarta Sans", sans-serif;
    --display: "Outfit", sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body.auth {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--navy-soft);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

a:hover { color: var(--navy); }

/* Decorative watermark scene */
.auth-scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.auth-scene__mark {
    position: absolute;
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: rgba(8, 10, 82, 0.045);
    white-space: nowrap;
    user-select: none;
}

.auth-scene__mark--top {
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(4rem, 14vw, 9rem);
}

.auth-scene__mark--bottom {
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(2.5rem, 8vw, 5.5rem);
}

/* Full-bleed shell — the card IS the viewport, no side gutters */
.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--surface);
    overflow: hidden;
}

/* ── Hero / visual panel ── */
.auth-visual {
    position: relative;
    isolation: isolate;
    color: #fff;
    min-height: 100%;
}

.auth-visual__media {
    position: absolute;
    inset: 0;
}

.auth-visual__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.auth-visual__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(160deg, rgba(8, 10, 82, 0.55) 0%, rgba(8, 10, 82, 0.35) 45%, rgba(8, 10, 82, 0.72) 100%),
        linear-gradient(90deg, rgba(8, 10, 82, 0.15), transparent 55%);
}

.auth-visual__body {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    padding-right: clamp(3rem, 6vw, 4.5rem);
    max-width: 26rem;
}

.auth-visual__eyebrow {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green);
}

.auth-visual__title {
    margin: 0 0 0.75rem;
    font-family: var(--display);
    font-size: clamp(1.55rem, 2.6vw, 2.15rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.auth-visual__text {
    margin: 0 0 1.35rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.auth-visual__features {
    list-style: none;
    margin: 0;
    padding: 1.1rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    display: grid;
    gap: 0.55rem;
}

.auth-visual__features li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.78);
}

.auth-visual__dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(148, 201, 116, 0.25);
}

/* Organic wave divider */
.auth-wave {
    position: absolute;
    top: 0;
    right: -1px;
    width: clamp(36px, 5vw, 52px);
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ── Form panel ── */
.auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(2rem, 4.5vw, 3.5rem) clamp(1.75rem, 5vw, 4rem);
    padding-left: clamp(1.25rem, 3.5vw, 3rem);
}

/* Centers the form block independent of the footer below it */
.auth-panel__main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-panel__head {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.auth-brand-mark {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.auth-brand-mark__icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(148, 201, 116, 0.22);
}

.auth-brand-mark__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.auth-brand-mark__welcome {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.auth-brand-mark__name {
    font-family: var(--display);
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--navy);
    line-height: 1.1;
}

.auth-brand-mark__logo {
    display: block;
    max-width: 168px;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-panel__tagline {
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.45;
}

/* Alerts */
.auth-alert,
.alert {
    margin: 0 0 1.1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: rgba(192, 57, 43, 0.07);
    border: 1px solid rgba(192, 57, 43, 0.16);
    color: var(--danger);
    font-size: 0.85rem;
}

.auth-alert p { margin: 0; }
.auth-alert p + p { margin-top: 0.3rem; }

.alert ul {
    margin: 0;
    padding-left: 1rem;
}

.alert-success {
    background: rgba(148, 201, 116, 0.14);
    border-color: rgba(148, 201, 116, 0.35);
    color: #2f5e1c;
}

.alert-dismissible { position: relative; padding-right: 2.2rem; }

.alert .close {
    position: absolute;
    top: 0.45rem;
    right: 0.6rem;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

/* Form — minimalist underline inputs */
.auth-form {
    display: grid;
    gap: 1.35rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.auth-field__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-field__row label {
    margin-bottom: 0.45rem;
}

.auth-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-bottom: 0.45rem;
}

.auth-link:hover {
    color: var(--navy);
}

.auth-input {
    position: relative;
}

.auth-input input {
    width: 100%;
    height: 44px;
    padding: 0.5rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
}

.auth-input input::placeholder {
    color: #a8afc4;
}

.auth-input__line {
    display: block;
    height: 1.5px;
    background: var(--line);
    border-radius: 2px;
    transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.auth-input:focus-within .auth-input__line {
    background: var(--green);
    transform: scaleY(1.4);
}

.auth-input input.is-invalid + .auth-input__line {
    background: rgba(192, 57, 43, 0.55);
}

.auth-field-error {
    margin: 0.4rem 0 0;
    font-size: 0.76rem;
    line-height: 1.3;
    color: var(--danger);
    min-height: 0;
}

.auth-field-error:empty {
    display: none;
}

@keyframes auth-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.auth-field--shake {
    animation: auth-shake 0.4s var(--ease);
}

.auth-input--password input {
    padding-right: 2.5rem;
}

.auth-eye {
    position: absolute;
    right: 0;
    bottom: 0.55rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.auth-eye svg {
    display: block;
    flex-shrink: 0;
}

.auth-eye .eye-closed,
.auth-eye svg[hidden] {
    display: none !important;
}

.auth-eye.is-showing .eye-open {
    display: none !important;
}

.auth-eye.is-showing .eye-closed {
    display: block !important;
}

.auth-eye:hover {
    color: var(--navy);
    background: rgba(8, 10, 82, 0.05);
}

/* Pill CTA */
.auth-submit {
    position: relative;
    margin-top: 0.5rem;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
    box-shadow: 0 12px 28px rgba(8, 10, 82, 0.22);
}

.auth-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 16px 36px rgba(8, 10, 82, 0.28);
}

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

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

.auth-submit__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

.auth-submit.is-loading {
    filter: brightness(0.94);
}

.auth-submit.is-loading .auth-submit__label {
    display: none;
}

.auth-submit.is-loading .auth-submit__spinner {
    display: inline-block;
    animation: auth-spin 0.7s linear infinite;
}

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

/* Demo quick-fill */
.auth-demo {
    margin-top: 1.5rem;
    padding-top: 1.15rem;
    border-top: 1px dashed var(--line);
}

.auth-demo > span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.auth-demo > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.auth-demo button {
    height: 32px;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fafbfe;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.auth-demo button:hover {
    border-color: rgba(148, 201, 116, 0.75);
    color: var(--navy);
    background: rgba(148, 201, 116, 0.12);
}

.auth-panel__foot {
    flex-shrink: 0;
    width: 100%;
    max-width: 380px;
    padding-top: 1.5rem;
}

.auth-credit {
    margin: 0;
    font-size: 0.74rem;
    color: var(--muted);
    text-align: center;
}

.auth-credit a {
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .auth-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-visual {
        min-height: 0;
    }

    .auth-panel {
        min-height: 0;
    }

    .auth-panel__main,
    .auth-panel__foot {
        max-width: 420px;
    }

    .auth-visual {
        min-height: 200px;
        max-height: 240px;
    }

    .auth-visual__body {
        max-width: none;
        padding: 1.35rem 1.5rem;
        justify-content: flex-end;
    }

    .auth-visual__title {
        font-size: 1.35rem;
        margin-bottom: 0.4rem;
    }

    .auth-visual__text,
    .auth-visual__features {
        display: none;
    }

    .auth-wave {
        display: none;
    }

    .auth-visual__overlay {
        background:
            linear-gradient(180deg, rgba(8, 10, 82, 0.35) 0%, rgba(8, 10, 82, 0.72) 100%);
    }

    .auth-panel {
        padding: 1.75rem 1.5rem 2rem;
    }

    .auth-scene__mark--top {
        top: 2%;
        font-size: clamp(3rem, 18vw, 5rem);
    }

    .auth-scene__mark--bottom {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-visual {
        min-height: 160px;
        max-height: 180px;
    }

    .auth-panel {
        padding: 1.5rem 1.25rem 1.75rem;
    }

    .auth-brand-mark__name {
        font-size: 1.5rem;
    }
}

@media (max-height: 680px) and (min-width: 861px) {
    .auth-visual__text {
        display: none;
    }

    .auth-visual__features {
        padding-top: 0.75rem;
        gap: 0.4rem;
    }

    .auth-panel {
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }
}

/* Short mobile viewports (landscape phones) — drop the hero, form only */
@media (max-width: 860px) and (max-height: 520px) {
    .auth-card {
        grid-template-rows: 1fr;
        overflow-y: auto;
    }

    .auth-visual {
        display: none;
    }

    .auth-panel {
        padding: 1.25rem 1.5rem;
        justify-content: center;
    }

    .auth-panel__main {
        flex: 0 1 auto;
    }

    .auth-panel__head {
        margin-bottom: 1rem;
    }

    .auth-form {
        gap: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }
}
