:root {
    --wth-red: #c41e3a;
    --wth-red-dark: #9e1730;
    --wth-red-light: #f8e8eb;
    --wth-navy: #0f1d35;
    --wth-navy-mid: #1a2d4d;
    --wth-blue: #2a5aa7;
    --wth-gray-50: #f8f9fb;
    --wth-gray-100: #eef0f4;
    --wth-gray-200: #d8dce5;
    --wth-gray-500: #6b7280;
    --wth-gray-700: #374151;
    --wth-gray-900: #111827;
    --wth-white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--wth-gray-50);
    color: var(--wth-gray-900);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════ */

.navbar {
    background: linear-gradient(135deg, var(--wth-navy) 0%, var(--wth-navy-mid) 100%) !important;
    padding: 0.6rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-bottom: 3px solid var(--wth-red);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: 6px;
    transition: all 0.15s;
}

.navbar .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 6px;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover {
    background: var(--wth-gray-100);
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */

.btn-primary {
    background-color: var(--wth-red);
    border-color: var(--wth-red);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    transition: all 0.15s;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--wth-red-dark);
    border-color: var(--wth-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-outline-primary {
    color: var(--wth-red);
    border-color: var(--wth-red);
    font-weight: 500;
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background-color: var(--wth-red);
    border-color: var(--wth-red);
    color: #fff;
}

.btn-outline-secondary {
    border-radius: 8px;
    font-weight: 500;
}

.btn-success {
    border-radius: 8px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */

.card {
    border: 1px solid var(--wth-gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--wth-white);
}

.card-header {
    background-color: var(--wth-white);
    border-bottom: 1px solid var(--wth-gray-200);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-header h5 {
    font-size: 1rem;
    color: var(--wth-navy);
}

.card-body {
    padding: 1.25rem;
}

/* ═══════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════ */

.badge {
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.35em 0.7em;
    border-radius: 6px;
}

.status-badge {
    font-size: 0.8rem;
    padding: 0.45em 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════
   UPLOAD AREAS
   ═══════════════════════════════════════════════════════ */

.upload-area {
    border: 2px dashed var(--wth-gray-200);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--wth-gray-50);
}

.upload-area:hover {
    border-color: var(--wth-red);
    background-color: var(--wth-red-light);
}

.upload-area i {
    color: var(--wth-gray-200);
    transition: color 0.2s;
}

.upload-area:hover i {
    color: var(--wth-red);
}

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */

.thead-dark th {
    background-color: var(--wth-navy);
    border-color: var(--wth-navy);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

.table td, .table th {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--wth-gray-50);
}

/* ═══════════════════════════════════════════════════════
   ADMIN DASHBOARD SUMMARY CARDS
   ═══════════════════════════════════════════════════════ */

.card a.card-body {
    color: inherit;
    transition: background 0.15s;
}

.card a.card-body:hover {
    text-decoration: none;
    background-color: var(--wth-gray-50);
}

.card.border-primary {
    border-left: 4px solid var(--wth-red) !important;
}

/* ═══════════════════════════════════════════════════════
   FORMS (inside cards / authenticated pages)
   ═══════════════════════════════════════════════════════ */

.form-control {
    border-radius: 8px;
    border: 1px solid var(--wth-gray-200);
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--wth-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--wth-gray-700);
    margin-bottom: 0.3rem;
}

/* ═══════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════ */

.alert {
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   PUBLIC PAGES (login, setup, etc)
   ═══════════════════════════════════════════════════════ */

.brand-header {
    color: var(--wth-navy);
    font-weight: 800;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-header i {
    color: var(--wth-red);
}

/* ═══════════════════════════════════════════════════════
   APPLY PAGE (public form)
   ═══════════════════════════════════════════════════════ */

.apply-page {
    background: var(--wth-gray-50);
    min-height: 100vh;
}

.apply-hero {
    background: linear-gradient(135deg, var(--wth-navy) 0%, #1e3a5f 50%, var(--wth-navy-mid) 100%);
    color: white;
    padding: 3.5rem 1.5rem 4.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.apply-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--wth-red);
}

.apply-hero-inner {
    max-width: 680px;
    margin: 0 auto;
}

.apply-hero-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    color: rgba(255,255,255,0.9);
}

.apply-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 1rem;
}

.apply-hero-sub {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

.apply-container {
    max-width: 1100px;
    margin: -2rem auto 0;
    padding: 0 1.5rem 3rem;
    position: relative;
    z-index: 1;
}

.apply-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: start;
}

.apply-card {
    background: var(--wth-white);
    border-radius: 14px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--wth-gray-200);
}

.apply-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--wth-navy);
    margin: 0 0 0.3rem;
}

.apply-card-sub {
    color: var(--wth-gray-500);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.apply-card .form-field {
    margin-bottom: 1rem;
}

.apply-card label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--wth-gray-700);
    margin-bottom: 0.35rem;
}

.apply-card label .optional {
    font-weight: 400;
    color: var(--wth-gray-500);
    font-size: 0.8rem;
}

.apply-card input[type="text"],
.apply-card input[type="email"],
.apply-card input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--wth-gray-200);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--wth-white);
}

.apply-card input:focus {
    outline: none;
    border-color: var(--wth-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.apply-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--wth-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 0.5rem;
}

.apply-btn:hover {
    background: var(--wth-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.3);
}

.apply-login-link {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.9rem;
    color: var(--wth-gray-500);
}

.apply-login-link a {
    color: var(--wth-red);
    font-weight: 600;
    text-decoration: none;
}

.apply-login-link a:hover {
    text-decoration: underline;
}

/* Apply Info Sidebar */
.apply-info-card {
    background: var(--wth-white);
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--wth-gray-200);
    margin-bottom: 1.25rem;
}

.apply-info-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wth-navy);
    margin: 0 0 1rem;
}

.apply-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.apply-checklist li {
    padding: 0.45rem 0;
    font-size: 0.9rem;
    color: var(--wth-gray-700);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.apply-checklist i {
    color: var(--wth-red);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.apply-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.apply-step {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--wth-navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.apply-step strong {
    display: block;
    font-size: 0.9rem;
    color: var(--wth-navy);
}

.apply-step p {
    margin: 0.1rem 0 0;
    font-size: 0.82rem;
    color: var(--wth-gray-500);
}

.apply-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--wth-gray-500);
    font-size: 0.8rem;
    border-top: 1px solid var(--wth-gray-200);
}

.apply-footer p {
    margin: 0;
    line-height: 1.6;
}

/* Flash messages on apply page */
.flash-msg {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.flash-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ═══════════════════════════════════════════════════════
   SUBMISSION FORM
   ═══════════════════════════════════════════════════════ */

.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.submission-header h3 {
    font-weight: 800;
    color: var(--wth-navy);
    font-size: 1.4rem;
}

.submission-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.autosave-indicator {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    white-space: nowrap;
}

.autosave-indicator.saved {
    color: #166534;
    background: #f0fdf4;
}

.autosave-indicator.unsaved {
    color: #92400e;
    background: #fffbeb;
}

.autosave-indicator.saving {
    color: #1e40af;
    background: #eff6ff;
}

.autosave-indicator.failed {
    color: #991b1b;
    background: #fef2f2;
}

.progress-bar-wrap {
    background: var(--wth-white);
    border: 1px solid var(--wth-gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.section-card .card-header.section-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
}

.section-number {
    width: 30px;
    height: 30px;
    background: var(--wth-navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.section-header h5 {
    font-size: 1rem;
    font-weight: 700;
}

.section-header small {
    font-weight: 400;
}

.empty-section {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--wth-gray-500);
}

.empty-section i {
    color: var(--wth-gray-200);
}

.empty-section p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

.submission-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .apply-hero h1 {
        font-size: 1.8rem;
    }

    .apply-hero {
        padding: 2.5rem 1rem 3.5rem;
    }

    .apply-grid {
        grid-template-columns: 1fr;
    }

    .apply-card {
        padding: 1.5rem;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .upload-area {
        min-height: 100px;
        padding: 16px;
    }
}
