/* ============================================================
   Auth Shell — shared split-panel frame for public auth pages
   (login, register, forgot/reset password). Generalized from the
   original login_form.css so every entry page matches.
   Loaded by layouts/auth.php after brand-palette.css.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --auth-green:       #067a43;
    --auth-green-dark:  #035a31;
    --auth-green-mid:   #0f9a57;
    --auth-gold:        #d4a31b;
    --auth-ink:         #1a2332;
    --auth-muted:       #6b7890;
    --auth-bg:          #eef1f5;
    --auth-radius:      1.15rem;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    color: var(--auth-ink);
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(6, 122, 67, 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(212, 163, 27, 0.08), transparent 60%),
        var(--auth-bg);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

/* ── card ─────────────────────────────────────────────────────── */
.auth-card {
    border-radius: var(--auth-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ── LEFT RAIL ───────────────────────────────────────────────── */
.auth-rail {
    position: relative;
    background: linear-gradient(170deg, #046a3a 0%, #078e4e 45%, #0fa85c 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    overflow: hidden;
}
.auth-rail::before {
    content: '';
    position: absolute;
    width: 260px; height: 260px;
    border-radius: 50%;
    border: 40px solid rgba(255, 255, 255, 0.04);
    top: -80px; left: -80px;
    pointer-events: none;
}
.auth-rail::after {
    content: '';
    position: absolute;
    width: 180px; height: 180px;
    border-radius: 50%;
    border: 30px solid rgba(255, 255, 255, 0.04);
    bottom: -50px; right: -30px;
    pointer-events: none;
}

.auth-rail-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2.5rem 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-rail-welcome {
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.70);
    margin-bottom: 1.2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-rail-logo-wrap {
    width: 140px; height: 140px;
    margin: 0 auto 1.2rem;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}
.auth-rail-logo { width: 109.2px; height: 109.2px; object-fit: contain; filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff); border-radius: 0; }
.auth-app-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
    margin-bottom: 0;
    line-height: 1;
}
.auth-portal-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1rem;
    line-height: 1.5;
    max-width: 220px;
}
.auth-role {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    margin: 0;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    letter-spacing: 0.01em;
}

/* wave divider (rail → white) */
.auth-wave {
    position: absolute;
    top: 0; right: -1px; bottom: 0;
    width: 50px;
    z-index: 3;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 480' preserveAspectRatio='none'%3E%3Cpath d='M50 0 C28 80, 0 120, 0 240 C0 360, 28 400, 50 480 L50 0Z' fill='%23ffffff'/%3E%3C/svg%3E")
        right center / 100% 100% no-repeat;
}

/* ── RIGHT SIDE (form) ───────────────────────────────────────── */
.auth-form-side { background: #fff; }
.auth-form-inner { padding: 2.2rem 2.4rem; }

.auth-back-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--auth-muted);
    text-decoration: none;
    padding: 0.22rem 0.65rem;
    border-radius: 2rem;
    border: 1px solid #dce1e8;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.auth-back-link:hover {
    background: rgba(6, 122, 67, 0.04);
    border-color: var(--auth-green);
    color: var(--auth-green);
}

.auth-form-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--auth-ink);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}
.auth-form-lead {
    color: var(--auth-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* ── form controls ───────────────────────────────────────────── */
.auth-form-side .form-label,
.auth-card .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #3a4560;
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}
.auth-card .form-control,
.auth-card .form-select {
    font-family: 'Poppins', sans-serif;
    border-radius: 0.45rem;
    border: 1.5px solid #dce1e8;
    padding: 0.52rem 0.8rem;
    font-size: 0.88rem;
    color: var(--auth-ink);
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-card .form-control::placeholder { color: #a0aab8; font-weight: 400; }
.auth-card .form-control:focus,
.auth-card .form-select:focus {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px rgba(6, 122, 67, 0.10);
    background: #fff;
}

/* password toggle (login JS targets these class/IDs) */
.password-toggle {
    border-left: 0;
    border-radius: 0 0.45rem 0.45rem 0;
    width: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1.5px solid #dce1e8;
    background: #fafbfc;
    color: var(--auth-muted);
    transition: color 0.2s;
}
.password-toggle:hover { color: var(--auth-green); }
.password-field { border-radius: 0.45rem 0 0 0.45rem !important; border-right: 0 !important; }
.toggle-icon { width: 1rem; height: 1rem; }

/* ── primary button ──────────────────────────────────────────── */
.auth-card .btn-primary {
    font-family: 'Poppins', sans-serif;
    background: var(--auth-green);
    border: none;
    border-radius: 0.45rem;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.52rem 1.8rem;
    color: #fff;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(6, 122, 67, 0.22);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus-visible {
    background: var(--auth-green-dark);
    box-shadow: 0 6px 20px rgba(6, 122, 67, 0.30);
    transform: translateY(-1px);
}

/* ── action links (forgot / register / back) ─────────────────── */
.auth-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid #ebeef2;
}
.btn-link-forgot {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--auth-ink);
    text-decoration: none;
    padding: 0;
}
.btn-link-forgot:hover { color: var(--auth-green); text-decoration: underline; }
.btn-register {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--auth-green);
    border: 1.5px solid var(--auth-green);
    border-radius: 0.45rem;
    padding: 0.28rem 1.1rem;
    background: transparent;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.btn-register:hover { background: var(--auth-green); color: #fff; }

.auth-card .alert { border-radius: 0.45rem; font-size: 0.85rem; }

/* ── FORM FOOTER (register line + help links) ────────────────── */
.auth-register-line {
    text-align: center;
    font-size: 0.83rem;
    color: #6b7890;
    margin: 1rem 0 0;
}

.auth-register-line a {
    color: #067a43;
    font-weight: 600;
    text-decoration: none;
}

.auth-register-line a:hover {
    text-decoration: underline;
}

.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ebeef2;
    flex-wrap: wrap;
}

.auth-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
    text-decoration: none;
}

.auth-footer-link svg {
    width: 0.95rem;
    height: 0.95rem;
}

.auth-footer-link:hover {
    color: #067a43;
}

.auth-footer-divider {
    width: 1px;
    height: 0.9rem;
    background: #d0d5dd;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .auth-rail { min-height: 220px; }
    .auth-wave {
        top: auto; right: 0; bottom: -1px; left: 0;
        width: 100%; height: 40px;
        background:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C225 0, 675 0, 900 40 Z' fill='%23ffffff'/%3E%3C/svg%3E")
            center bottom / 100% 100% no-repeat;
    }
    .auth-rail-logo-wrap { width: 112px; height: 112px; }
    .auth-rail-logo      { width: 89.6px; height: 89.6px; }
    .auth-role           { font-size: 1.15rem; }
    .auth-app-name       { font-size: 1.4rem; }
    .auth-rail-welcome   { font-size: 0.75rem; margin-bottom: 0.8rem; }
}
@media (max-width: 575.98px) {
    .auth-shell { padding: 1rem 0; }
    .auth-card { border-radius: 0.75rem; }
    .auth-form-inner { padding: 1.5rem 1.2rem; }
    .auth-form-title { font-size: 1.15rem; }
    .auth-card .btn-primary { width: 100%; }
}
