/* =============================================================================
   app.css - Shared Design Language
   =============================================================================
   Every module reuses these tokens and component classes. Never redefine
   colors/spacing/typography locally in a module -- add to this file instead,
   so the "one design language throughout the system" requirement holds as
   more modules are built.
   ============================================================================= */

:root {
    /* Color: deep navy (authority, official documents) + muted brass-gold
       (seal/stamp accent) -- chosen for a passport/visa-handling enterprise
       system, not a generic SaaS palette. */
    --brand-navy: #10233F;
    --brand-navy-light: #1B3A63;
    --brand-navy-dark: #0A1930;
    --brand-gold: #C08A2E;
    --brand-gold-light: #D9A94F;

    --paper: #F6F7F9;
    --surface: #FFFFFF;
    --ink: #1B2027;
    --muted: #6B7280;
    --border: #E3E6EA;

    --success: #2E7D52;
    --success-bg: #EAF6EF;
    --danger: #B3261E;
    --danger-bg: #FDECEA;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(16, 35, 63, 0.08);
    --shadow-lg: 0 12px 40px rgba(16, 35, 63, 0.14);

    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    margin: 0;
}

h1, h2, h3, .brand-word {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

/* -----------------------------------------------------------------------
   Auth shell: split panel layout used by Login + Setup Wizard
   ----------------------------------------------------------------------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
}

.auth-brand-panel {
    flex: 0 0 42%;
    background: linear-gradient(160deg, var(--brand-navy) 0%, var(--brand-navy-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    /* faint guilloché-style radial texture, purely decorative CSS, no image asset */
    content: "";
    position: absolute;
    inset: -20%;
    background-image: radial-gradient(circle, rgba(192,138,46,0.10) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.5;
}

.auth-seal {
    position: relative;
    z-index: 1;
    width: 108px;
    height: 108px;
    margin-bottom: 28px;
}

.auth-seal .ring-outer {
    transform-origin: 54px 54px;
    animation: seal-rotate 40s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .auth-seal .ring-outer { animation: none; }
}

@keyframes seal-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-brand-word {
    position: relative;
    z-index: 1;
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 6px;
    text-align: center;
}

.auth-brand-tagline {
    position: relative;
    z-index: 1;
    font-size: 13.5px;
    color: rgba(255,255,255,0.68);
    text-align: center;
    max-width: 280px;
    line-height: 1.6;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-form-card {
    width: 100%;
    max-width: 380px;
}

.auth-form-card h1 {
    font-size: 22px;
    margin: 0 0 6px;
    color: var(--brand-navy);
}

.auth-form-card p.sub {
    color: var(--muted);
    font-size: 13.5px;
    margin: 0 0 28px;
}

@media (max-width: 860px) {
    .auth-shell { flex-direction: column; }
    .auth-brand-panel { flex: 0 0 auto; padding: 32px 24px; }
    .auth-seal { width: 64px; height: 64px; margin-bottom: 16px; }
    .auth-brand-word { font-size: 20px; }
    .auth-brand-tagline { display: none; }
}

/* -----------------------------------------------------------------------
   Form components (shared across every module going forward)
   ----------------------------------------------------------------------- */
.field-group { margin-bottom: 18px; }

.field-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}

.field-group .form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-group .form-control:focus {
    outline: none;
    border-color: var(--brand-navy-light);
    box-shadow: 0 0 0 3px rgba(27, 58, 99, 0.12);
}

.btn-brand {
    width: 100%;
    padding: 12px;
    background: var(--brand-navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-brand:hover { background: var(--brand-navy-light); }
.btn-brand:focus-visible { outline: 3px solid var(--brand-gold-light); outline-offset: 2px; }

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    margin-bottom: 20px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    margin-bottom: 20px;
}

.alert-error ul, .alert-success ul { margin: 0; padding-left: 18px; }

fieldset.form-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    padding: 16px 18px 6px;
}

fieldset.form-section legend {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-navy-light);
    padding: 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* -----------------------------------------------------------------------
   Dashboard shell (used post-login)
   ----------------------------------------------------------------------- */
.app-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-topbar .user-info { font-size: 13.5px; color: var(--muted); }
.app-topbar .user-info strong { color: var(--ink); }

.app-topbar a.logout-link {
    color: var(--danger);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.app-topbar a.logout-link:hover { text-decoration: underline; }

.app-content { padding: 28px; }

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}