/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    /* Neutral colors */
    --bg-neutral: #fafaf9;
    --bg-card: #ffffff;
    --text-dark: #1c1917;
    --text-medium: #44403c;
    --text-light: #78716c;
    --border-light: #e7e5e4;

    /* Accent colors by goal */
    --accent-cons: #0f766e;
    --accent-cons-light: #ccfbf1;
    --accent-deon: #6d28d9;
    --accent-deon-light: #ede9fe;
    --accent-virt: #b45309;
    --accent-virt-light: #fef3c7;

    /* Interactive states */
    --hover-bg: #f5f5f4;
    --focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.2);

    /* Spacing & sizing */
    --radius: 10px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 48px;

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===========================
   Base Styles
   =========================== */
body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-neutral);
    padding: var(--space-md);
    min-height: 100vh;
}

.container {
    max-width: 720px;
    margin: 0 auto;
}

/* ===========================
   Header
   =========================== */
.header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.header h1 {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-medium);
    margin-bottom: var(--space-sm);
}

.explainer {
    font-size: var(--font-size-base);
    color: var(--text-light);
}

/* ===========================
   Quiz Form
   =========================== */
.quiz-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.question-group {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--space-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.question-group legend {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
    padding: 0;
}

.helper-text {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: var(--space-md);
}

.options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.option-label {
    display: flex;
    align-items: flex-start;
    padding: var(--space-md);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-label:hover {
    background-color: var(--hover-bg);
    border-color: var(--text-light);
}

.option-label:has(input:checked) {
    border-color: var(--accent-cons);
    background-color: var(--accent-cons-light);
}

.option-label:has(input:focus-visible) {
    outline: 2px solid var(--accent-cons);
    outline-offset: 2px;
}

.option-label input[type="radio"] {
    margin-top: 2px;
    margin-right: var(--space-sm);
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-text strong {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-dark);
}

.option-text small {
    font-size: 14px;
    color: var(--text-medium);
}

/* ===========================
   Buttons
   =========================== */
.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--accent-cons);
    color: white;
    width: 100%;
    margin-top: var(--space-md);
}

.btn-primary:hover {
    background-color: #0d5f57;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--accent-cons);
    outline-offset: 2px;
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-dark);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    background-color: var(--hover-bg);
    border-color: var(--text-light);
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--accent-cons);
    outline-offset: 2px;
}

/* ===========================
   Result Section
   =========================== */
.result-section {
    margin-top: var(--space-xl);
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 6px solid var(--accent-cons);
    border-radius: var(--radius);
    padding: var(--space-lg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.result-card.goal-cons {
    border-left-color: var(--accent-cons);
}

.result-card.goal-deon {
    border-left-color: var(--accent-deon);
}

.result-card.goal-virt {
    border-left-color: var(--accent-virt);
}

.result-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
}

.result-blurb {
    font-size: var(--font-size-lg);
    color: var(--text-medium);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.result-vehicle,
.result-profile {
    margin-bottom: var(--space-lg);
}

.result-vehicle h3,
.result-profile h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: var(--space-sm);
}

.result-vehicle p {
    font-size: var(--font-size-base);
    color: var(--text-dark);
    background: var(--bg-neutral);
    padding: var(--space-md);
    border-radius: var(--radius);
}

.result-vehicle p a {
    color: var(--accent-cons);
    text-decoration: underline;
    font-weight: 600;
}

.result-vehicle p a:hover {
    color: #0d5f57;
}

.result-vehicle p a:focus-visible {
    outline: 2px solid var(--accent-cons);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Profile Chips */
.profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-neutral);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-dark);
}

.chip.goal-cons {
    background: var(--accent-cons-light);
    border-color: var(--accent-cons);
    color: var(--accent-cons);
}

.chip.goal-deon {
    background: var(--accent-deon-light);
    border-color: var(--accent-deon);
    color: var(--accent-deon);
}

.chip.goal-virt {
    background: var(--accent-virt-light);
    border-color: var(--accent-virt);
    color: var(--accent-virt);
}

/* Result Actions */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
}

.result-actions .btn-secondary {
    flex: 1 1 auto;
    min-width: 140px;
}

/* ===========================
   Toast Notification
   =========================== */
.toast {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    background: var(--text-dark);
    color: white;
    padding: var(--space-md) var(--space-md);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 15px;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .quiz-form,
    .result-actions {
        display: none;
    }

    .result-card {
        box-shadow: none;
        border: 2px solid var(--text-dark);
    }

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

/* ===========================
   Responsive Design
   =========================== */
@media (min-width: 640px) {
    body {
        padding: var(--space-lg);
    }

    .header h1 {
        font-size: 38px;
    }

    .question-group {
        padding: var(--space-lg);
    }

    .result-card {
        padding: var(--space-xl);
    }
}

/* ===========================
   Accessibility Enhancements
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent-cons);
    outline-offset: 2px;
}

/* Hidden attribute support */
[hidden] {
    display: none !important;
}
