/* ══════════════════════════════════════════
   AEC Enrollment Portal — Global Stylesheet
   ══════════════════════════════════════════ */

:root {
    --primary:    #002855;
    --primary-mid:#003a7a;
    --primary-lt: #1a4a8a;
    --accent:     #c8860a;
    --bg:         #dde3eb;
    --surface:    #ffffff;
    --border:     #c5cdd8;
    --text:       #1f2937;
    --muted:      #6b7280;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: Inter, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    min-height: 100%;
}

/* ── Site top-bar ── */
.site-topbar {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 24px;
}

.site-topbar img {
    height: 52px;
    width:  52px;
    object-fit: contain;
    flex-shrink: 0;
}

.site-topbar-title { flex: 1; }
.site-topbar-title h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.site-topbar-title p { margin: 2px 0 0; font-size: 0.76rem; opacity: 0.72; }

.site-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-user { font-size: 0.82rem; opacity: 0.75; white-space: nowrap; }

/* ── Content shell ── */
.site-body {
    max-width: 980px;
    margin: 28px auto 56px;
    padding: 0 16px;
}

.site-body-wide {
    max-width: 1200px;
    margin: 28px auto 56px;
    padding: 0 16px;
}

/* ── Cards ── */
.site-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,0.07);
    margin-bottom: 20px;
}

.card-head {
    background: var(--primary-mid);
    color: #fff;
    padding: 8px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--accent);
}

.card-body { padding: 22px 24px; }

/* ── Info grid (label + value rows) ── */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    border: 1px solid var(--border);
    padding: 0;
    vertical-align: top;
}

.info-table .lbl {
    background: #f0f4f9;
    padding: 8px 13px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1c3557;
    width: 32%;
    white-space: nowrap;
}

.info-table .val {
    padding: 8px 13px;
    font-size: 0.88rem;
    color: var(--text);
}

/* ── Status pills ── */
.pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pill-draft     { background: #f1f5f9; color: #475569; }
.pill-submitted { background: #fef3c7; color: #92400e; }
.pill-approved  { background: #dcfce7; color: #166534; }
.pill-rejected  { background: #fee2e2; color: #991b1b; }

/* Legacy alias */
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; text-transform: uppercase; }
.status-draft     { background: #f1f5f9; color: #475569; }
.status-submitted { background: #fef3c7; color: #92400e; }
.status-approved  { background: #dcfce7; color: #166534; }
.status-rejected  { background: #fee2e2; color: #991b1b; }

/* ── Buttons ── */
.btn, .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.18s;
    white-space: nowrap;
}
.btn:hover, .button-link:hover { opacity: 0.88; transform: translateY(-1px); }

.btn.secondary, .button-link.secondary { background: #475569; }
.btn.danger,    .button-link.danger    { background: #b91c1c; }
.btn.outline,   .button-link.outline   {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.4);
    color: #fff;
}
.btn.outline:hover, .button-link.outline:hover { background: rgba(255,255,255,0.12); }

.topbar-logout {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fff;
    padding: 6px 14px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s;
}
.topbar-logout:hover { background: rgba(255,255,255,0.24); }

/* ── Alert / notice boxes ── */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.alert-warn    { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* ── Form elements (shared, used in login/register) ── */
.form-field { margin-bottom: 16px; }
.form-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1c3557;
    margin-bottom: 5px;
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="tel"] {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    outline: none;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus {
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px rgba(0,58,122,0.08);
}
.form-field .field-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ── Centered auth layout ── */
.auth-wrap {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.11);
    width: 420px;
    max-width: 100%;
    overflow: hidden;
}

.auth-card .auth-head {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 24px 20px 20px;
}
.auth-card .auth-head img  { height: 64px; margin-bottom: 10px; }
.auth-card .auth-head h2   { margin: 0 0 4px; font-size: 1.1rem; font-weight: 800; }
.auth-card .auth-head p    { margin: 0; font-size: 0.78rem; opacity: 0.75; }

.auth-card .auth-body { padding: 24px 28px 28px; }

/* ── Grid helpers ── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .site-topbar { padding: 10px 14px; gap: 10px; }
    .site-topbar-title h1 { font-size: 0.9rem; }
}

/* ── Print ── */
@media print {
    body { background: white; }
    .no-print, .no-print * { display: none !important; }
    .site-topbar { display: none; }
}

/* ── Legacy classes kept for enrollment_form.php compatibility ── */
.page-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.07);
    margin-bottom: 20px;
}
.section-title { margin: 16px 0 10px; font-size: 1rem; font-weight: 700; color: var(--primary); }
.form-grid { display: grid; gap: 16px; }
.form-group { display: grid; gap: 6px; }
.help-text  { color: var(--muted); font-size: 0.88rem; }
.footer-note { color: var(--muted); font-size: 0.85rem; margin-top: 16px; }
.notice {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 14px 18px;
    border-radius: 10px;
    color: var(--muted);
}
