:root {
    --primary: #0b3c6d;
    --primary-dark: #072a4d;
    --secondary: #0f6e8c;
    --accent-green: #2f6b8f;
    --accent-green-hover: #285f80;
    --background: #f5f7fa;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #5c6b7a;
    --border: #cbd5e1;
    --split-brand: 58%;
    --split-form: 42%;
}

* {
    box-sizing: border-box;
}

body.auth-page-login {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--surface);
    color: var(--text);
}

body.auth-page-login input,
body.auth-page-login select,
body.auth-page-login textarea,
body.auth-page-login button {
    font-family: 'Poppins', sans-serif;
}

/* ── Split layout ───────────────────────────────────────── */

.auth-wrapper.auth-wrapper--split {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

/* Brand panel (wider, asymmetrical left side) */

.auth-brand-panel {
    position: relative;
    flex: 0 0 var(--split-brand);
    max-width: var(--split-brand);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    padding: 3rem clamp(2rem, 4vw, 3.5rem);
    background: linear-gradient(
        145deg,
        var(--primary-dark) 0%,
        var(--primary) 42%,
        var(--secondary) 100%
    );
    color: #fff;
    overflow: hidden;
    text-align: center;
}

.auth-brand-logo-wrap {
    --logo-wrap-a: var(--secondary);
    --logo-wrap-b: var(--primary);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 220px);
    aspect-ratio: 1;
    flex-shrink: 0;
    padding: 0.35rem;
    border-radius: 58% 42% 48% 52% / 52% 48% 55% 45%;
    background: linear-gradient(
        145deg,
        var(--logo-wrap-a) 0%,
        var(--logo-wrap-b) 52%,
        var(--primary-dark) 100%
    );
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    animation: logoWrapWave 4s ease-in-out infinite;
    overflow: visible;
}

.auth-brand-logo-wrap::before {
    content: "";
    position: absolute;
    inset: -6px;
    z-index: -1;
    border-radius: 52% 48% 45% 55% / 48% 52% 50% 50%;
    background: linear-gradient(
        155deg,
        var(--logo-wrap-b) 0%,
        var(--logo-wrap-a) 48%,
        var(--secondary) 100%
    );
    opacity: 0.55;
    animation: logoWrapWaveOuter 4s ease-in-out infinite reverse;
}

.auth-brand-logo-backdrop {
    position: absolute;
    inset: 12%;
    z-index: 0;
    border-radius: 50% 46% 54% 50% / 48% 54% 46% 52%;
    background: rgb(255, 255, 255);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.65),
        0 8px 28px rgba(7, 42, 77, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    animation: logoWrapWaveInner 4s ease-in-out infinite 0.15s;
}

@keyframes logoWrapWave {
    0%,
    100% {
        border-radius: 58% 42% 48% 52% / 52% 48% 55% 45%;
        transform: translateY(0) rotate(0deg);
    }
    25% {
        border-radius: 48% 52% 55% 45% / 58% 42% 50% 50%;
        transform: translateY(-5px) rotate(0.6deg);
    }
    50% {
        border-radius: 52% 48% 42% 58% / 45% 55% 52% 48%;
        transform: translateY(4px) rotate(-0.5deg);
    }
    75% {
        border-radius: 45% 55% 52% 48% / 52% 48% 42% 58%;
        transform: translateY(-3px) rotate(0.4deg);
    }
}

@keyframes logoWrapWaveOuter {
    0%,
    100% {
        border-radius: 52% 48% 45% 55% / 48% 52% 50% 50%;
        transform: scale(1) rotate(0deg);
    }
    33% {
        border-radius: 60% 40% 50% 50% / 42% 58% 55% 45%;
        transform: scale(1.04) rotate(2deg);
    }
    66% {
        border-radius: 44% 56% 58% 42% / 55% 45% 48% 52%;
        transform: scale(0.98) rotate(-1.5deg);
    }
}

@keyframes logoWrapWaveInner {
    0%,
    100% {
        border-radius: 50% 46% 54% 50% / 48% 54% 46% 52%;
    }
    50% {
        border-radius: 46% 54% 50% 50% / 54% 46% 52% 48%;
    }
}

.auth-brand-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-brand-orb {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    filter: blur(1px);
}

.auth-brand-orb--1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    animation: floatOrb 12s ease-in-out infinite;
}

.auth-brand-orb--2 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    left: -40px;
    animation: floatOrb 9s ease-in-out infinite reverse;
}

.auth-brand-orb--3 {
    width: 140px;
    height: 140px;
    bottom: -30px;
    right: 25%;
    background: rgba(76, 175, 80, 0.12);
    animation: floatOrb 11s ease-in-out infinite 1s;
}

@keyframes floatOrb {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(12px, -18px) scale(1.05);
    }
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-brand-logo {
    position: relative;
    z-index: 1;
    width: clamp(88px, 10vw, 108px);
    height: clamp(88px, 10vw, 108px);
    object-fit: contain;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(11, 60, 109, 0.2));
}

.auth-brand-eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.auth-brand-headline {
    margin: 0 0 1.75rem;
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.auth-brand-features {
    margin: 0 auto;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    width: fit-content;
    max-width: 100%;
}

.auth-brand-features li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
    text-align: left;
}

.auth-brand-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

/* Organic wavy divider between panels */

.auth-wave-divider {
    position: absolute;
    color: var(--surface);
    z-index: 2;
    pointer-events: none;
}

.auth-wave-divider--vertical {
    top: 0;
    right: -1px;
    width: clamp(72px, 8vw, 120px);
    height: 100%;
    color: var(--surface);
    filter: drop-shadow(-4px 0 12px rgba(11, 60, 109, 0.06));
}

.auth-wave-divider--horizontal {
    display: none;
}

/* Form panel — compact, filled layout */

.auth-wrapper--split .auth-panel {
    flex: 1 1 var(--split-form);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 3vw, 2rem);
    min-width: 0;
    /* Remove gray/light background so panel appears clean */
    background: transparent;
}

.auth-wrapper--split .auth-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    animation: fadeIn 0.5s ease;
}

body.auth-page-login .auth-wrapper--split .logo-container,
body.auth-page-login .auth-wrapper--split .auth-card > h1 {
    display: none;
}

.auth-wrapper--split .subtitle {
    margin: 0 0 0.75rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.45;
}

.auth-wrapper--split .auth-card > .alert-success,
.auth-wrapper--split .auth-card > .alert-error {
    margin-bottom: 0.75rem;
}

/* Login intro (replaces floating subtitle) */

.auth-login-intro {
    margin: 0 0 1rem;
    text-align: left;
}

.auth-login-intro__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text);
}

.auth-login-intro__text {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-muted);
    max-width: 28ch;
}

/* Form card */

.auth-login-card {
    background: var(--surface);
    border: 1px solid rgba(11, 60, 109, 0.08);
    border-radius: 16px;
    padding: 1.35rem 1.5rem 1.15rem;
    box-shadow:
        0 4px 6px rgba(11, 60, 109, 0.04),
        0 12px 32px rgba(11, 60, 109, 0.08);
}

.auth-login-footnote {
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.02em;
}

/* ── Form & controls ────────────────────────────────────── */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
}

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

.auth-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text);
}

.auth-form .auth-field input {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--background);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

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

.auth-form .auth-field input:focus {
    outline: none;
    border-color: var(--secondary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(15, 110, 140, 0.12);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.1rem;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
    padding: 0.82rem 1.25rem;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--secondary) 100%
    );
    box-shadow: 0 4px 14px rgba(11, 60, 109, 0.28);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.auth-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(11, 60, 109, 0.32);
}

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

.auth-submit__icon {
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.auth-submit:hover .auth-submit__icon {
    transform: translateX(2px);
}

.alert-success,
.alert-error {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.875rem;
}

.alert-success {
    background: #e7f7ea;
    color: #266b2a;
}

.alert-error {
    background: #ffe9e9;
    color: #861b1b;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 960px) {
    :root {
        --split-brand: 52%;
        --split-form: 48%;
    }

    .auth-brand-panel {
        padding: 2.5rem 2rem;
    }

    .auth-brand-headline {
        font-size: 1.35rem;
    }

    .auth-brand-features {
        display: none;
    }
}

@media (max-width: 720px) {
    .auth-wrapper.auth-wrapper--split {
        flex-direction: column;
    }

    .auth-brand-panel {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
        min-height: 220px;
        padding: 2rem 1.5rem 3.5rem;
        align-items: center;
        justify-content: center;
        gap: 1.25rem;
    }

    .auth-brand-content {
        max-width: none;
    }

    .auth-brand-logo {
        width: 88px;
        height: 88px;
    }

    .auth-brand-headline {
        font-size: 1.15rem;
        margin-bottom: 0;
    }

    .auth-brand-eyebrow {
        font-size: 0.72rem;
    }

    .auth-wave-divider--vertical {
        display: none;
    }

    .auth-wave-divider--horizontal {
        display: block;
        bottom: -1px;
        left: 0;
        width: 100%;
        height: 52px;
        color: var(--surface);
        filter: drop-shadow(0 -4px 12px rgba(11, 60, 109, 0.06));
    }

    .auth-wrapper--split .auth-panel {
        flex: 1;
        padding: 1.5rem 1.25rem 2rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-wrapper--split .auth-card {
        max-width: 100%;
    }

    .auth-login-intro {
        margin-bottom: 1rem;
    }

    .auth-login-intro__title {
        font-size: 1.35rem;
    }

    .auth-login-card {
        padding: 1.25rem 1.25rem 1rem;
    }
}

@media (max-width: 639px) {
    .auth-wrapper,
    .auth-wrapper.auth-wrapper--split { min-height: 100vh; min-height: 100dvh; width: 100%; }
    .auth-panel,
    .auth-card,
    .auth-login-card { width: 100%; max-width: 100%; }
    input,
    select,
    textarea { font-size: 16px; }
    button,
    a[role="button"] { min-height: 44px; }
}
