/* ============================================================
   MuscleAge Assessment Styles
   Modern, Accessible, Responsive Design
   ============================================================ */

/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

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

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--light);
    line-height: 1.6;
    min-height: 100vh;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    z-index: 100;
    transition: top var(--transition-fast);
}
.skip-link:focus {
    top: 0;
}

.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;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* CRITICAL FIX: Ensure hidden attribute works */
[hidden] {
    display: none !important;
}

/* Header */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    height: 36px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-list a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Burger Toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: var(--gray-100);
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Burger -> X animation when active */
.nav-toggle--active .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle--active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle--active .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Overlay behind the open mobile nav */
.nav-overlay {
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 49;
}

body.nav-open {
    overflow: hidden;
}

/* Main Content */
.assessment-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* Progress */
.progress-container {
    margin-bottom: 40px;
}

.progress-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
    transition: width var(--transition-slow);
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    list-style: none;
    gap: 8px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: default;
}

.step-item.active {
    background: var(--primary-light);
}

.step-item.active .step-number {
    background: var(--primary);
    color: var(--white);
}

.step-item.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all var(--transition-base);
}

.step-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
}

/* Form */
.assessment-form {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* CRITICAL FIX: Form steps visibility */
.form-step {
    display: none;
    padding: 40px;
    border: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-legend {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.legend-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    opacity: 0.3;
    font-family: var(--font-mono);
}

.legend-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.legend-content p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

.form-group--full {
    grid-column: 1 / -1;
}

.form-group--highlight {
    grid-column: 1 / -1;
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

/* Form Elements */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-label--question {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.5;
}

.required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition-fast);
}

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

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input--readonly {
    background: var(--gray-100);
    cursor: default;
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-light);
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0;
}

.input-with-unit .form-input {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    border-right: none;
}

.unit-label {
    padding: 12px 16px;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 6px;
}

.error-message {
    display: block;
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 6px;
    min-height: 18px;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    color: var(--gray-700);
}

.radio-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary);
    background: var(--primary);
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
    display: block;
}

/* SARC-F Styling */
.sarc-f-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sarc-f-item {
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.sarc-f-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.sarc-f-question {
    flex: 1;
}

/* Likert Scale */
.likert-scale {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.likert-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 100px;
    background: var(--white);
}

.likert-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.likert-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.likert-option input[type="radio"]:checked + .likert-value {
    background: var(--primary);
    color: var(--white);
}

.likert-option:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.likert-value {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all var(--transition-fast);
}

.likert-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-align: center;
}

/* Score Display */
.score-display {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-light), #eff6ff);
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary-light);
    margin-top: 24px;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.score-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    font-family: var(--font-mono);
}

.score-max {
    font-size: 1rem;
    color: var(--gray-400);
    font-weight: 600;
}

.score-interpretation {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.score-status {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--success);
}

.score-cutoff {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Activity Cards */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.activity-card {
    position: relative;
}

.activity-label {
    cursor: pointer;
    display: block;
}

.activity-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    background: var(--white);
}

.activity-content:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.activity-card:has(input:checked) .activity-content {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.activity-card--negative:has(input:checked) .activity-content {
    border-color: var(--danger);
    background: var(--danger-light);
}

.activity-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
}

.activity-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.activity-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.activity-score-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 8px;
}

.activity-score-badge--negative {
    background: var(--danger-light);
    color: var(--danger);
}

.activity-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.activity-card:has(input:checked) .activity-check {
    background: var(--primary);
    border-color: var(--primary);
}

.activity-card--negative:has(input:checked) .activity-check {
    background: var(--danger);
    border-color: var(--danger);
}

.check-icon {
    width: 16px;
    height: 16px;
    fill: var(--white);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.activity-card:has(input:checked) .check-icon {
    opacity: 1;
}

/* Activity Scoring Info */
.activity-scoring-info {
    margin-bottom: 24px;
}

.score-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.score-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.score-positive .score-dot {
    background: var(--success-light);
    color: var(--success);
}

.score-negative .score-dot {
    background: var(--danger-light);
    color: var(--danger);
}

/* Measurement Info */
.measurement-info {
    margin-bottom: 24px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    font-size: 0.875rem;
    color: var(--gray-700);
}

.info-card--warning {
    background: var(--warning-light);
    border-left-color: var(--warning);
}

.info-card svg {
    flex-shrink: 0;
    color: var(--primary);
}

.info-card--warning svg {
    color: var(--warning);
}

.measurement-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Risk Indicator */
.risk-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-weight: 600;
}

.risk-indicator.risk-low {
    background: var(--success-light);
    color: var(--success);
}

.risk-indicator.risk-moderate {
    background: var(--warning-light);
    color: var(--warning);
}

.risk-indicator.risk-high {
    background: var(--danger-light);
    color: var(--danger);
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn--primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgb(37 99 235 / 0.2);
}

.btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgb(37 99 235 / 0.3);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn--secondary:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.btn--large {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn svg {
    flex-shrink: 0;
}

/* Error Summary */
.error-summary {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.error-summary h3 {
    color: var(--danger);
    font-size: 1rem;
    margin-bottom: 8px;
}

.error-summary ul {
    list-style: none;
    padding-left: 0;
}

.error-summary li {
    color: var(--danger);
    font-size: 0.875rem;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.error-summary li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--danger);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay.active {
    display: flex !important;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.loading-subtext {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex !important;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 2;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Footer */
.app-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 40px 24px;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-disclaimer {
    font-size: 0.75rem;
    margin-top: 8px;
    color: var(--gray-500);
}

/* BMI Category */
.bmi-category {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.bmi-underweight { background: var(--warning-light); color: var(--warning); }
.bmi-normal { background: var(--success-light); color: var(--success); }
.bmi-overweight { background: var(--warning-light); color: var(--warning); }
.bmi-obese { background: var(--danger-light); color: var(--danger); }

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-list {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: max-height var(--transition-base), opacity var(--transition-base), transform var(--transition-base);
        z-index: 50;
    }

    .nav-list--open {
        max-height: calc(100vh - 64px);
        opacity: 1;
        transform: translateY(0);
        overflow-y: auto;
    }

    .nav-list a {
        display: block;
        padding: 16px 20px;
        border-bottom: 1px solid var(--gray-100);
        border-left: 3px solid transparent;
    }

    .nav-list a:hover,
    .nav-list a[aria-current="page"] {
        border-bottom-color: var(--gray-100);
        border-left-color: var(--primary);
        background: var(--primary-light);
    }

    .assessment-main {
        padding: 16px 12px 60px;
    }

    .progress-container {
        margin-bottom: 20px;
    }

    .form-step {
        padding: 20px 16px;
    }

    .step-legend {
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .legend-number {
        font-size: 1.75rem;
    }

    .legend-content h2 {
        font-size: 1.2rem;
    }

    .form-grid,
    .form-grid--measurements,
    .activity-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .step-indicators {
        gap: 2px;
    }

    .step-label {
        display: none;
    }

    .step-item {
        padding: 6px;
        justify-content: center;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .likert-scale {
        flex-direction: column;
        gap: 8px;
    }

    .likert-option {
        flex-direction: row;
        justify-content: flex-start;
        min-width: auto;
        padding: 12px 16px;
        gap: 12px;
    }

    .likert-value {
        font-size: 1rem;
        width: 28px;
        height: 28px;
    }

    .step-actions {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 24px;
        padding-top: 16px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }

    .score-display {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .score-value {
        font-size: 2rem;
    }

    .activity-content {
        padding: 14px;
        gap: 12px;
    }

    .activity-icon {
        font-size: 1.5rem;
    }

    .activity-title {
        font-size: 0.9rem;
    }

    .activity-desc {
        font-size: 0.7rem;
    }

    .score-legend {
        gap: 8px;
    }

    .score-item {
        font-size: 0.8rem;
    }

    .sarc-f-item {
        padding: 16px;
    }

    .sarc-f-letter {
        font-size: 1.25rem;
        width: 30px;
        height: 30px;
    }

    .sarc-f-question {
        font-size: 0.875rem;
    }

    .info-card {
        font-size: 0.8rem;
        padding: 12px;
    }

    .measurement-group {
        padding: 0;
    }

    .form-group--highlight {
        padding: 14px;
    }

    .risk-indicator {
        font-size: 0.875rem;
        padding: 10px 12px;
    }

    /* Modal responsive */
    .modal {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-content {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 92vh;
    }

    .modal-close {
        top: 12px;
        right: 12px;
    }

    /* Error summary */
    .error-summary {
        padding: 12px 14px;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .assessment-main {
        padding: 12px 10px 60px;
    }

    .form-step {
        padding: 16px 12px;
    }

    .legend-content h2 {
        font-size: 1.05rem;
    }

    .legend-number {
        display: none;
    }

    .btn {
        font-size: 0.875rem;
        padding: 12px 16px;
    }
}

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

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .app-header, .step-actions, .progress-container, .app-footer {
        display: none;
    }

    .form-step {
        display: block !important;
        page-break-inside: avoid;
    }
}