:root {
    /* Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ffffff;
    --secondary-hover: #f9fafb;
    --secondary-border: #d1d5db;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    --success: #10b981;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --warning: #f59e0b;
    --warning-text: #d97706;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Fonts */
    --font-sans: 'Inter', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
}

/* Layout Containers */
.container {
    max-width: 80rem; /* max-w-6xl */
    margin-left: auto;
    margin-right: auto;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.container-narrow {
    max-width: 48rem; /* max-w-3xl */
    margin-left: auto;
    margin-right: auto;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

/* Typography */
h1 {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.025em;
    color: var(--text-main);
}

h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

p {
    margin: 0;
}

.subtitle {
    color: var(--text-light);
    font-size: 0.875rem; /* text-sm */
    margin-top: var(--spacing-xs);
}

/* Utilities */
.hidden { display: none !important; }
.opacity-0 { opacity: 0; }
.transition-opacity { transition: opacity 0.3s ease-in-out; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-base { font-size: 1rem; }
.text-muted { color: var(--text-light); }

/* Text Colors */
.text-gray-900 { color: var(--text-main); }
.text-gray-800 { color: #1f2937; }
.text-gray-700 { color: #374151; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: var(--text-light); }
.text-gray-400 { color: #9ca3af; }
.text-indigo-900 { color: #312e81; }
.text-indigo-800 { color: #3730a3; }
.text-indigo-600 { color: var(--primary); }
.text-indigo-500 { color: #6366f1; }
.text-red-900 { color: #7f1d1d; }
.text-red-500 { color: var(--danger); }
.text-red-600 { color: #dc2626; }

/* Hover Text Colors */
.hover\:text-indigo-500:hover { color: #6366f1; }
.hover\:text-indigo-900:hover { color: #312e81; }
.hover\:text-red-900:hover { color: #7f1d1d; }

/* Colors for Score */
.text-green-600 { color: #16a34a; }
.text-yellow-600 { color: #ca8a04; }

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mt-6 { margin-top: var(--spacing-xl) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mb-8 { margin-bottom: 2rem !important; }
.pt-4 { padding-top: 1rem !important; }
.pb-4 { padding-bottom: 1rem !important; }
.pb-12 { padding-bottom: 3rem !important; }

.w-full { width: 100%; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: var(--spacing-lg); }
.gap-8 { gap: 2rem; }

.inline { display: inline; }
.inline-flex { display: inline-flex; }

/* Grid */
.grid {
    display: grid;
    /*gap: 2rem; */
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
    .sm\:flex { display: flex; }
    .sm\:items-center { align-items: center; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:w-auto { width: auto; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    gap: 0.5rem;
    line-height: 1.25rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover { background-color: var(--primary-hover); }

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

.btn-danger { color: var(--danger); background: none; padding: 0.25rem; }
.btn-danger:hover { color: var(--danger-text); }

.btn-success { background-color: var(--success); color: white; }
.btn-success:hover { background-color: var(--success-text); }

.text-indigo-600 { color: var(--primary); }
a.text-indigo-600:hover { color: var(--primary-hover); }

.btn svg { width: 1.25rem; height: 1.25rem; }

/* Components: Cards */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-empty {
    text-align: center;
    padding: 3rem;
    background-color: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Components: Forms */
label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-main);
}

.form-input,
.form-select,
input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--secondary-border);
    box-shadow: var(--shadow-sm);
    padding: 0.625rem 0.75rem;
    background-color: white;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-top: 0.25rem;
    font-family: inherit;
}

/* Fix Dropdown Style */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1em 1em;
    padding-right: 2.5rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="checkbox"] {
    accent-color: var(--primary);
}

.intensity-input {
    width: 100%;
    font-weight: 700;
    color: var(--primary);
}

/* Selection Cards (Checkboxes/Radios) */
.selection-card {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background-color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}
.selection-card:hover { background-color: var(--background); }
.selection-card input { width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; flex-shrink: 0; }
.selection-card span { margin-left: 0.75rem; font-weight: 500; color: var(--text-main); }

.selection-card-header {
    background-color: var(--background);
    border-color: var(--border);
    width: 100%;
    margin-bottom: 0.75rem;
}

/* Section Styling */
.section-card {
    background-color: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.section-header {
    background-color: var(--background);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-body { padding: 1.5rem; }
.section-body > * + * { margin-top: 2rem; } /* space-y-8 */

/* Table */
.overflow-x-auto { overflow-x: auto; }
table { min-width: 100%; border-collapse: collapse; }
thead { background-color: var(--background); }
th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
}
td {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    white-space: nowrap;
}
tr:hover { background-color: var(--background); }
.text-right { text-align: right; }

/* Badges */
.badge, .rounded-full {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.bg-red-100 { background-color: var(--danger-bg); }
.text-red-800 { color: var(--danger-text); }
.bg-green-100 { background-color: var(--success-bg); }
.text-green-800 { color: var(--success-text); }
.bg-gray-100 { background-color: #f3f4f6; }

/* Wizard Progress */
.wizard-progress-container {
    background-color: #f3f4f6;
    border-radius: 9999px;
    height: 0.625rem;
    overflow: hidden;
    width: 100%;
}
.wizard-progress-bar {
    background-color: var(--primary);
    height: 100%;
    transition: width 0.5s ease-out;
}

/* Fixed Footer */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 1px solid var(--border);
    padding: 1rem;
    box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.1);
    z-index: 20;
}
.footer-content {
    max-width: 48rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sticky Header in Form */
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.bg-white { background-color: white; }
.bg-gray-50 { background-color: var(--background); }
.border-gray-100 { border-color: #f3f4f6; }
.border-t { border-top-width: 1px; }

.rounded-xl { border-radius: var(--radius-xl); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.border { border-width: 1px; border-style: solid; }
.border-gray-200 { border-color: var(--border); }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-100 { border-color: #f3f4f6; }
.border-indigo-100 { border-color: #e0e7ff; }
.border-indigo-500 { border-color: #6366f1; }
.border-2 { border-width: 2px; }

.p-4 { padding: 1rem; }
.p-12 { padding: 3rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

/* Specific Overrides */
.max-w-6xl { max-width: 72rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.bg-indigo-600 { background-color: var(--primary); }
.bg-green-600 { background-color: var(--success); }
.hover\:bg-green-700:hover { background-color: var(--success-text); }
.hover\:bg-gray-50:hover { background-color: var(--background); }
.text-white { color: white; }

.space-y-8 > * + * { margin-top: 2rem; }

/* SVG icons */
svg { display: block; }
