/**
 * Badge & Hose — Base Styles
 * Mobile-first responsive design for consumer test prep.
 *
 * Color system: Professional, trustworthy — navy/gold as primary.
 * Typography: System font stack (no external fonts for CSP compliance).
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    /* Primary palette */
    --bh-navy: #1a2744;
    --bh-navy-light: #2a3f66;
    --bh-navy-dark: #0f1a2e;
    --bh-gold: #c8992e;
    --bh-gold-light: #e6b84d;
    --bh-gold-muted: #d4a94533;

    /* Neutrals */
    --bh-white: #ffffff;
    --bh-off-white: #f7f8fa;
    --bh-gray-100: #f0f1f4;
    --bh-gray-200: #e1e3e8;
    --bh-gray-300: #c4c8d0;
    --bh-gray-500: #6b7280;
    --bh-gray-700: #374151;
    --bh-gray-900: #111827;

    /* Semantic */
    --bh-success: #16a34a;
    --bh-success-bg: #f0fdf4;
    --bh-error: #dc2626;
    --bh-error-bg: #fef2f2;
    --bh-warning: #d97706;
    --bh-warning-bg: #fffbeb;
    --bh-info: #2563eb;
    --bh-info-bg: #eff6ff;

    /* Typography */
    --font-body: 'Segoe UI', Arial, sans-serif;
    --font-heading: 'Segoe UI', Arial, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Layout */
    --max-width: 1200px;
    --header-height: 64px;

    /* Borders & Shadows */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--bh-gray-900);
    background-color: var(--bh-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Accessibility
   ============================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    z-index: 10000;
    padding: var(--space-sm) var(--space-md);
    background: var(--bh-navy);
    color: var(--bh-white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: var(--space-sm);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--bh-gold);
    outline-offset: 2px;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--bh-navy);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--bh-info);
    text-decoration: underline;
}

a:hover {
    color: var(--bh-navy);
}

/* ============================================
   Layout
   ============================================ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-xl);
    }
}

/* ============================================
   Header
   ============================================ */
.site-header {
    height: var(--header-height);
    background: var(--bh-navy);
    color: var(--bh-white);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bh-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.site-logo .ampersand {
    color: var(--bh-gold);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.site-nav a {
    color: var(--bh-gray-200);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav a:hover {
    color: var(--bh-white);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--bh-gold);
    color: var(--bh-navy-dark);
    border-color: var(--bh-gold);
}

.btn-primary:hover:not(:disabled) {
    background: var(--bh-gold-light);
    border-color: var(--bh-gold-light);
}

.btn-secondary {
    background: var(--bh-navy);
    color: var(--bh-white);
    border-color: var(--bh-navy);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bh-navy-light);
    border-color: var(--bh-navy-light);
}

.btn-outline {
    background: transparent;
    color: var(--bh-navy);
    border-color: var(--bh-navy);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bh-navy);
    color: var(--bh-white);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bh-white);
    border: 1px solid var(--bh-gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bh-gray-700);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1px solid var(--bh-gray-300);
    border-radius: var(--radius-md);
    background: var(--bh-white);
    color: var(--bh-gray-900);
    transition: border-color 0.15s;
}

.form-input:focus {
    border-color: var(--bh-gold);
    outline: none;
    box-shadow: 0 0 0 3px var(--bh-gold-muted);
}

.form-input.error {
    border-color: var(--bh-error);
}

.form-error {
    color: var(--bh-error);
    font-size: 0.8rem;
    margin-top: var(--space-xs);
}

/* ============================================
   Alerts / Feedback
   ============================================ */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
}

.alert-success {
    background: var(--bh-success-bg);
    color: var(--bh-success);
    border: 1px solid var(--bh-success);
}

.alert-error {
    background: var(--bh-error-bg);
    color: var(--bh-error);
    border: 1px solid var(--bh-error);
}

.alert-warning {
    background: var(--bh-warning-bg);
    color: var(--bh-warning);
    border: 1px solid var(--bh-warning);
}

.alert-info {
    background: var(--bh-info-bg);
    color: var(--bh-info);
    border: 1px solid var(--bh-info);
}

/* ============================================
   Progress Bars
   ============================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bh-gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--bh-gold);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--bh-navy-dark);
    color: var(--bh-gray-300);
    padding: var(--space-2xl) 0;
    margin-top: var(--space-3xl);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--bh-gray-200);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--bh-white);
    text-decoration: underline;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--bh-gray-500); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ============================================
   Responsive Helpers
   ============================================ */
.hide-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: initial;
    }
    .hide-desktop {
        display: none;
    }
}
