/* ==========================================================
   login.css — matches the parent portal look
   (navy + magenta, soft pink/blue circles, Plus Jakarta Sans).
   ========================================================== */

/* ───────── page ───────── */
.auth-page {
    --a-navy: var(--navy, #17407a);
    --a-navy-dark: var(--navy-dark, #0f2f5c);
    --a-magenta: var(--magenta, #c8105f);
    --a-pink: var(--soft-pink, #fde8f0);
    --a-blue: var(--soft-blue, #e8f0fb);
    --a-border: var(--border, #dbe3ef);
    --a-muted: var(--muted, #6b7a90);
    --a-bg: var(--color-bg, #f6f8fc);
    --a-field: #f3f6fb;
    --a-text: #1b2a41;
    --a-danger: #e5484d;

    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', -apple-system, 'Inter', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--a-bg);
    position: relative;
    overflow-x: hidden;
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.auth-page::before {
    width: 560px; height: 560px;
    top: -260px; right: -180px;
    background: var(--a-pink);
    opacity: 0.85;
}
.auth-page::after {
    width: 460px; height: 460px;
    bottom: -240px; left: -120px;
    background: var(--a-blue);
}

.auth-page-wrap {
    width: 92%;
    max-width: 900px;
    padding: 1.5rem 0;
    position: relative;
    z-index: 1;
}

/* keyboard focus ring for links/buttons only (NOT the text inputs,
   they get their own ring on the .input-group wrapper) */
.auth-page a:focus-visible,
.auth-page button:focus-visible,
.auth-page .remember-me input:focus-visible {
    outline: 3px solid rgba(200, 16, 95, 0.4);
    outline-offset: 2px;
}

/* ───────── split card ───────── */
.split-container {
    display: flex;
    min-height: 540px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--a-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(23, 64, 122, 0.14);
}

.split-image {
    position: relative;
    width: 45%;
    overflow: hidden;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}
.split-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.split-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 47, 92, 0.25) 0%, rgba(15, 47, 92, 0.92) 100%);
    z-index: 1;
}
.split-image::after {
    content: "";
    position: absolute;
    width: 220px; height: 220px;
    border-radius: 50%;
    left: -80px; bottom: -110px;
    background: rgba(200, 16, 95, 0.5);
    z-index: 1;
}
.split-overlay { position: relative; z-index: 2; }
.split-overlay h2 {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
    color: #fff;
}
.split-overlay h2::after {
    content: "";
    display: block;
    width: 40px; height: 4px;
    border-radius: 4px;
    background: var(--a-magenta);
    margin-top: 0.8rem;
}
.split-overlay p {
    margin: 0.8rem 0 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.86);
    max-width: 30ch;
}

/* ───────── form side ───────── */
.split-form {
    width: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2.25rem;
    overflow-y: auto;
}

.form-inner {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.form-title {
    font-size: 1.9rem;
    color: var(--a-navy);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}
.form-title::after {
    content: "";
    display: block;
    width: 36px; height: 4px;
    border-radius: 4px;
    background: var(--a-magenta);
    margin-top: 0.5rem;
}

.form-subtitle {
    font-size: 0.86rem;
    color: var(--a-muted);
    margin: 0.8rem 0 0.4rem;
}

.flash-stack { width: 100%; margin-top: 1.1rem; }
.flash-msg {
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    margin: 0 0 0.5rem 0;
}
.flash-error   { background: #fdecec; color: #c0262d; }
.flash-success { background: #e6f6ee; color: #0f7b45; }

/* ───────── inputs ───────── */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 52px;
    margin-top: 1rem;
    padding-left: 1.1rem;
    gap: 0.75rem;
    background: var(--a-field);
    border: 1.5px solid transparent;
    border-radius: 12px;
    overflow: hidden;               /* keeps autofill paint inside the corners */
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-group:hover {
    border-color: var(--a-border);
}
.input-group:focus-within {
    background: #fff;
    border-color: var(--a-navy);
    box-shadow: 0 0 0 4px rgba(23, 64, 122, 0.10);
}

.input-group .field-icon {
    flex: none;
}
.input-group .field-icon path {
    fill: var(--a-muted);
    transition: fill 0.15s ease;
}
.input-group:focus-within .field-icon path {
    fill: var(--a-navy);
}

/* higher specificity than the old global :focus-visible rule,
   so no magenta box appears inside the field */
.auth-page .input-group input,
.auth-page .input-group input:focus,
.auth-page .input-group input:focus-visible {
    outline: none;
    box-shadow: none;
}
.input-group input {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: transparent;
    color: var(--a-text);
    border: none;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0 1rem 0 0;
}
.input-group input::placeholder {
    color: #9aa7ba;
    font-weight: 400;
}

/* Chrome / Safari autofill: paint with the field colour instead of blue */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--a-text);
    -webkit-box-shadow: 0 0 0 1000px var(--a-field) inset !important;
    caret-color: var(--a-text);
    transition: background-color 9999s ease-in-out 0s;
}
.input-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--a-text);
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    caret-color: var(--a-text);
}

/* invalid state: only after typing and leaving the field */
.input-group:has(input:not(:placeholder-shown):not(:focus):invalid) {
    border-color: var(--a-danger);
    background: #fff;
}

/* password toggle */
.toggle-pw {
    flex: none;
    width: 48px;
    height: 100%;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--a-muted);
    transition: color 0.15s ease;
}
.toggle-pw:hover { color: var(--a-navy); }
.toggle-pw .eye-off { display: none; }
.toggle-pw.is-visible .eye-on  { display: none; }
.toggle-pw.is-visible .eye-off { display: block; }

/* ───────── options row ───────── */
.form-options {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.1rem;
    color: var(--a-muted);
}
.form-link {
    font-size: 0.84rem;
    color: var(--a-magenta);
    text-decoration: none;
    font-weight: 700;
}
.form-link:hover { text-decoration: underline; }

.remember-me { display: flex; align-items: center; gap: 0.5rem; }
.remember-me label { font-size: 0.84rem; cursor: pointer; }
.remember-me input {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    width: 1.1rem;
    height: 1.1rem;
    border: 1.5px solid #c5d0e0;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.remember-me input:hover { border-color: var(--a-navy); }
.remember-me input:checked {
    background: var(--a-magenta);
    border-color: var(--a-magenta);
}
.remember-me input:checked::after {
    content: "";
    width: 0.3rem;
    height: 0.55rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* ───────── button ───────── */
.submit-btn {
    margin-top: 1.5rem;
    width: 100%;
    height: 50px;
    border-radius: 12px;
    color: #fff;
    background: var(--a-navy);
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(23, 64, 122, 0.22);
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.submit-btn:hover {
    background: var(--a-navy-dark);
    box-shadow: 0 10px 22px rgba(23, 64, 122, 0.28);
}
.submit-btn:active { transform: translateY(1px); }

/* ───────── links under the button ───────── */
.auth-links {
    width: 100%;
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-soft, #eaeff6);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.auth-links .auth-footer-text {
    margin: 0;
    font-size: 0.82rem;
    color: var(--a-muted);
    text-align: center;
}
.auth-links .auth-footer-text a {
    color: var(--a-magenta);
    font-weight: 700;
    border-bottom: 0;
    text-decoration: none;
}
.auth-links .auth-footer-text a:hover { text-decoration: underline; }

/* ───────── other auth pages (register, forgot password, …) ───────── */
.auth-wrap {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    background: #f9fafb;
}
.auth-card {
    width: 100%;
    max-width: 26rem;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.auth-eyebrow {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}
.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: #1f2937;
}
.auth-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
    line-height: 1.5;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label { font-size: 0.8rem; font-weight: 500; color: #374151; }
.form-field input {
    padding: 0.7rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}
.form-field input:focus { outline: none; border-color: #1f2937; }
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}
.auth-checkbox { display: flex; align-items: center; gap: 0.4rem; color: #4b5563; }
.auth-link {
    color: #1f2937;
    text-decoration: none;
    border-bottom: 1px solid #1f2937;
}
.auth-submit {
    padding: 0.85rem;
    background: #1f2937;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}
.auth-submit:hover { background: #111827; }
.auth-footer-text {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}
.auth-footer-text a {
    color: #1f2937;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #1f2937;
}

/* ───────── responsive ───────── */
@media (max-width: 900px) {
    .split-container { min-height: 0; }
    .split-image { width: 38%; padding: 1.5rem; }
    .split-form { width: 62%; padding: 2rem 1.5rem; }
    .split-overlay h2 { font-size: 1.25rem; }
}

@media (max-width: 680px) {
    .split-image { display: none; }
    .split-form { width: 100%; padding: 2rem 1.4rem; }
    .form-title { font-size: 1.7rem; }
    .auth-page::before { width: 360px; height: 360px; top: -180px; }
    .auth-page::after  { width: 320px; height: 320px; bottom: -180px; }
}

@media (prefers-reduced-motion: reduce) {
    .input-group, .submit-btn, .toggle-pw,
    .input-group .field-icon path, .remember-me input { transition: none; }
}