/**
 * NAVCDP sign-in — shared by sacco/login.php, fpo/login.php and the landing modal.
 * Form components are .auth-*; the full-page layout lives under .auth-page.
 */

:root {
    --auth-green: #2d6a30;
    --auth-green-dark: #0f281c;
    --auth-green-mid: #40916c;
    --auth-gold: #d1a63a;
    --auth-brown: #7a5230;
    --auth-ink: #0f172a;
    --auth-ink-soft: #475569;
    --auth-ink-muted: #64748b;
    --auth-border: #d5e0d9;
    --auth-surface: #f6faf7;
    --auth-danger: #b3261e;
    --auth-danger-tint: #fdecea;
    --auth-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── Form components ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: var(--auth-font);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-ink);
}

.auth-input-wrap {
    position: relative;
}

.auth-input {
    width: 100%;
    font: inherit;
    font-size: 0.95rem;
    color: var(--auth-ink);
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

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

.auth-input:hover { border-color: #b7c8bd; }

.auth-input:focus {
    outline: none;
    border-color: var(--auth-green-mid);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.18);
}

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

.auth-eye {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-ink-muted);
    cursor: pointer;
}

.auth-eye:hover { color: var(--auth-ink); background: var(--auth-surface); }
.auth-eye:focus-visible { outline: 2px solid var(--auth-green-mid); outline-offset: 1px; }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.83rem;
    line-height: 1.45;
    color: var(--auth-danger);
    background: var(--auth-danger-tint);
    border: 1px solid rgba(179, 38, 30, 0.2);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
}

.auth-alert[hidden] { display: none; }
.auth-alert i { margin-top: 0.15rem; }

.auth-submit {
    position: relative;
    width: 100%;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--auth-green);
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.auth-submit:hover { background: #255a28; }
.auth-submit:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.35); }

.auth-submit[aria-busy="true"] {
    cursor: progress;
    color: transparent;
}

.auth-submit[aria-busy="true"]::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

.auth-submit.is-success { background: var(--auth-green-dark); }

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

/* Portal choice (landing modal) */
.auth-radios {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.1rem;
    font-size: 0.83rem;
    color: var(--auth-ink);
}

.auth-radios__label {
    font-weight: 600;
    color: var(--auth-ink-soft);
}

.auth-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    cursor: pointer;
}

.auth-radio input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--auth-green);
    cursor: pointer;
}

/* ── Full-page sign in ── */
body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--auth-font);
    color: var(--auth-ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

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

.auth-page .tricolor { display: flex; height: 3px; flex-shrink: 0; }
.auth-page .tricolor span { flex: 1; }
.auth-page .tricolor span:nth-child(1) { background: #111; }
.auth-page .tricolor span:nth-child(2) { background: #b3261e; }
.auth-page .tricolor span:nth-child(3) { background: var(--auth-green); }

.auth-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    padding: 2.5rem clamp(2rem, 5vw, 4rem);
    color: #d8e8de;
    background:
        radial-gradient(80% 60% at 0% 0%, rgba(64, 145, 108, 0.28), transparent 60%),
        radial-gradient(60% 45% at 100% 100%, rgba(209, 166, 58, 0.12), transparent 60%),
        linear-gradient(160deg, #1a4d32 0%, #0f281c 45%, #081810 100%);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    font-size: 0.82rem;
    font-weight: 600;
    color: #b9d3c3;
    text-decoration: none;
}

.auth-back:hover { color: #fff; }

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

.auth-brand-mark img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    padding: 5px;
}

.auth-brand-mark span {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8fad9a;
}

.auth-brand-mark strong {
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: #fff;
}

.auth-brand h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}

.auth-brand h1 em {
    font-style: normal;
    color: var(--auth-gold);
}

.auth-brand-lead {
    margin: 0;
    max-width: 30rem;
    font-size: 0.98rem;
    line-height: 1.65;
    color: #b9d3c3;
}

.auth-brand-list {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    font-size: 0.88rem;
    color: #d8e8de;
}

.auth-brand-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.auth-brand-list i {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--auth-gold);
    background: rgba(209, 166, 58, 0.12);
    border: 1px solid rgba(209, 166, 58, 0.25);
    border-radius: 8px;
}

.auth-brand-foot {
    margin: 0;
    font-size: 0.78rem;
    color: #8fad9a;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #fff;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-card-head { margin-bottom: 1.75rem; }

.auth-kicker {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--auth-green-dark);
    background: #e8f5ec;
    border-radius: 999px;
}

.auth-kicker--fpo { color: var(--auth-brown); background: #f7ead8; }

.auth-card h2 {
    margin: 0 0 0.4rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--auth-ink);
}

.auth-card-lead {
    margin: 0;
    font-size: 0.9rem;
    color: var(--auth-ink-soft);
}

.auth-card-foot {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8eee9;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.83rem;
    color: var(--auth-ink-muted);
}

.auth-card-foot p { margin: 0; }

.auth-card-foot a {
    font-weight: 600;
    color: var(--auth-green);
    text-decoration: none;
}

.auth-card-foot a:hover { text-decoration: underline; }

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }

    .auth-brand {
        gap: 1.25rem;
        padding: 1.25rem 1rem 1.5rem;
    }

    .auth-brand-mark { margin-bottom: 1rem; }
    .auth-brand-mark img { width: 40px; height: 40px; border-radius: 10px; }
    .auth-brand h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
    .auth-brand-lead { font-size: 0.88rem; }
    .auth-brand-list, .auth-brand-foot { display: none; }

    .auth-main {
        align-items: flex-start;
        padding: 2rem 1rem 2.5rem;
    }
}
