@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Open+Sans:wght@600;700&display=swap');

:root {
    --auth-navy: #233A67;
    --auth-navy-dark: #162644;
    --auth-navy-light: #2E4B82;
    --auth-yellow: #FAD12C;
    --auth-yellow-hover: #E5BE1E;
    --auth-bg: #F4F6FA;
    --auth-card-bg: #FFFFFF;
    --auth-text-main: #0F172A;
    --auth-text-muted: #64748B;
    --auth-border: #D1D5DB;
    --auth-border-hover: #94A3B8;
    --auth-border-focus: #233A67;
    --auth-focus-ring: rgba(35, 58, 103, 0.14);
    --auth-radius: 22px;
    --auth-input-radius: 10px;
    --auth-shadow: 0 24px 64px -12px rgba(25, 43, 77, 0.12), 0 8px 24px -4px rgba(25, 43, 77, 0.04), 0 0 0 1px rgba(216, 221, 234, 0.7);
    --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-page {
    background: radial-gradient(circle at 10% 20%, rgba(35, 58, 103, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(250, 209, 44, 0.04) 0%, transparent 40%),
                var(--auth-bg);
    min-height: calc(100vh - 76px);
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px) 20px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--auth-text-main);
}

.auth-split {
    width: 100%;
    max-width: 1140px;
    min-height: 640px;
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    display: grid;
    grid-template-columns: minmax(400px, 450px) 1fr;
    overflow: hidden;
    border: 1px solid rgba(216, 221, 234, 0.7);
}

.auth-split.auth-split-register {
    max-width: 1140px;
    min-height: 640px;
    grid-template-columns: minmax(400px, 450px) 1fr;
}

.auth-visual {
    position: relative;
    background: var(--auth-navy);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: clamp(36px, 4vw, 48px);
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(25, 43, 77, 0.35) 0%, rgba(25, 43, 77, 0.88) 100%),
        radial-gradient(circle at 15% 105%, rgba(250, 209, 44, 0.35), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.12), transparent 45%);
    pointer-events: none;
    z-index: 1;
}

.auth-visual img,
.auth-visual img.auth-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0.75;
    mix-blend-mode: luminosity;
    transition: transform 1.2s var(--auth-ease);
}

.auth-split:hover .auth-visual img {
    transform: scale(1.03);
}

.auth-visual-overlay {
    position: relative;
    z-index: 2;
    color: #FFFFFF;
    max-width: 400px;
}

.auth-brand-mark {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.auth-brand-mark img {
    position: static;
    width: auto;
    height: 38px;
    object-fit: contain;
    opacity: 1;
    mix-blend-mode: normal;
}

.auth-visual-overlay h2 {
    margin: 0 0 12px;
    font-family: 'Open Sans', 'Inter', sans-serif;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}

.auth-visual-overlay p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

/* ==========================================================================
   Form Right Panel
   ========================================================================== */
.auth-panel {
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 4vw, 48px);
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card.auth-card-register,
.auth-split-register .auth-card {
    max-width: 520px;
}

.auth-header {
    margin-bottom: 22px;
}

.auth-card h1 {
    margin: 0 0 6px;
    font-family: 'Open Sans', 'Inter', sans-serif;
    font-size: clamp(1.55rem, 2.2vw, 1.85rem);
    line-height: 1.2;
    font-weight: 700;
    color: var(--auth-navy);
    letter-spacing: -0.025em;
}

.auth-card .auth-subtitle,
.auth-card > p {
    margin: 0 0 20px;
    color: var(--auth-text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-header p {
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form label,
.field label {
    display: block;
    margin: 0 0 6px;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-bottom: 0;
}

.field-full {
    margin-bottom: 14px;
}

.input-wrap {
    position: relative;
    width: 100%;
}

.input-wrap input,
.input-wrap select {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-input-radius);
    padding: 0 14px 0 38px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--auth-text-main);
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input:hover,
.input-wrap select:hover {
    border-color: var(--auth-border-hover);
}

.input-wrap input:focus,
.input-wrap select:focus {
    border-color: var(--auth-border-focus);
    background: #FFFFFF;
    box-shadow: 0 0 0 3.5px var(--auth-focus-ring), 0 1px 2px rgba(16, 24, 40, 0.05);
}

.input-wrap input::placeholder {
    color: #94A3B8;
    font-weight: 400;
    font-size: 0.88rem;
}

.input-wrap select {
    padding: 0 34px 0 38px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-wrap select:invalid,
.input-wrap select option[value=""][disabled] {
    color: #94A3B8;
}

.input-wrap select option {
    color: var(--auth-text-main);
    background: #FFFFFF;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: #94A3B8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.select-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94A3B8;
    pointer-events: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.input-wrap select:focus ~ .select-chevron {
    transform: translateY(-50%) rotate(180deg);
    color: var(--auth-navy);
}

.input-wrap input:focus ~ .input-icon,
.input-wrap input:not(:placeholder-shown) ~ .input-icon,
.input-wrap select:focus ~ .input-icon,
.input-wrap select:valid ~ .input-icon {
    color: var(--auth-navy);
}

/* Password Toggle*/

.input-wrap.has-pw-toggle input,
.input-wrap:has(.toggle-pw) input,
.input-wrap input[type="password"] {
    padding-right: 38px;
}

.input-wrap .toggle-pw {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s ease, background 0.15s ease;
}

.input-wrap .toggle-pw:hover {
    color: var(--auth-navy);
    background: rgba(35, 58, 103, 0.08);
}

.toggle-pw svg {
    width: 16px;
    height: 16px;
}

.toggle-pw .eye-closed {
    display: none;
}

.toggle-pw.is-visible .eye-open {
    display: none;
}

.toggle-pw.is-visible .eye-closed {
    display: block;
    color: var(--auth-navy);
}

/* Real-time Validation Feedback */
.field-msg,
.pw-feedback {
    display: none;
    font-size: 0.78rem;
    margin-top: 6px;
    line-height: 1.35;
}

.field-msg.is-visible,
.pw-feedback.is-visible {
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-msg.is-error,
.pw-feedback.is-error {
    color: #DC2626;
}

.field-msg.is-success,
.pw-feedback.is-success {
    color: #059669;
}

.input-wrap input.input-error {
    border-color: #EF4444;
}

.input-wrap input.input-success {
    border-color: #10B981;
}

/* Links, Checkboxes, Switches*/
.auth-links-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 20px;
    font-size: 0.88rem;
}

.auth-links-row .remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text-muted);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.auth-links-row .remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--auth-navy);
    cursor: pointer;
}

.auth-links-row a,
.auth-switch a,
.terms-text a {
    color: var(--auth-navy);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-links-row a:hover,
.auth-switch a:hover,
.terms-text a:hover {
    color: var(--auth-navy-light);
    text-decoration: underline;
}

.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0 20px;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.45;
    cursor: pointer;
    user-select: none;
}

.terms-check input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.terms-check .checkmark {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1.5px;
    border: 1.5px solid var(--auth-border);
    border-radius: 5px;
    background: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.terms-check .checkmark svg {
    width: 11px;
    height: 11px;
    color: #FFFFFF;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.terms-check input:checked + .checkmark {
    background: var(--auth-navy);
    border-color: var(--auth-navy);
}

.terms-check input:checked + .checkmark svg {
    opacity: 1;
    transform: scale(1);
}

.terms-check input:focus-visible + .checkmark {
    box-shadow: 0 0 0 3px var(--auth-focus-ring);
    border-color: var(--auth-navy);
}

.auth-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--auth-input-radius);
    background: linear-gradient(180deg, var(--auth-navy) 0%, var(--auth-navy-dark) 100%);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    margin: 4px 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(35, 58, 103, 0.22);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.auth-btn:hover {
    background: linear-gradient(180deg, var(--auth-navy-light) 0%, var(--auth-navy) 100%);
    box-shadow: 0 8px 22px rgba(35, 58, 103, 0.3);
    transform: translateY(-1px);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(35, 58, 103, 0.2);
}

.auth-btn .btn-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.auth-btn:hover .btn-arrow {
    transform: translateX(3px);
}

.auth-switch {
    margin: 0;
    color: var(--auth-text-muted);
    font-size: 0.88rem;
    text-align: center;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 18px;
    animation: authFadeIn 0.3s ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.auth-alert-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.auth-alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.auth-alert-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

.auth-hint {
    margin: -6px 0 12px;
    font-size: 0.82rem;
    color: var(--auth-text-muted);
}

@media (max-width: 960px) {
    .auth-page {
        padding: 24px 16px;
    }

    .auth-split,
    .auth-split.auth-split-register {
        grid-template-columns: 1fr;
        max-width: 540px;
        min-height: auto;
    }

    .auth-visual {
        min-height: 220px;
        padding: 32px 24px;
    }

    .auth-brand-mark {
        margin-bottom: 16px;
    }

    .auth-brand-mark img {
        height: 32px;
    }

    .auth-visual-overlay h2 {
        font-size: 1.35rem;
    }

    .auth-visual-overlay p {
        font-size: 0.9rem;
    }

    .auth-panel {
        padding: 32px 24px 40px;
    }
}

@media (max-width: 580px) {
    .auth-page {
        padding: 0;
        background: #FFFFFF;
    }

    .auth-split,
    .auth-split.auth-split-register {
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    .field-full {
        margin-bottom: 12px;
    }

    .auth-panel {
        padding: 24px 18px 36px;
    }

    .auth-card h1 {
        font-size: 1.5rem;
    }
}
