/* ==========================================================================
   Digital Menu Board Audit Tool - Styles
   SeenLabs Brand Colors + Light/Dark theme toggle
   Adapted from ROI Calculator
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (Design Tokens) - SEENLABS BRAND COLORS
   Primary: #0f4c81 | Complementary: #ff974f | Analogous: #17a2b8
   -------------------------------------------------------------------------- */
:root {
    /* Light Theme Colors */
    --bg-primary: #f4f7fa;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(15, 76, 129, 0.03);
    --border-color: rgba(7, 37, 64, 0.1);
    --border-color-hover: rgba(7, 37, 64, 0.2);

    --text-primary: #072540;
    --text-secondary: #4a6582;
    --text-muted: #7a93a9;

    /* Accent - SeenLabs Primary Blue */
    --accent: #0f4c81;
    --accent-light: #17a2b8;
    --accent-dark: #072540;
    --accent-gradient: linear-gradient(135deg, #0f4c81 0%, #17a2b8 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(15, 76, 129, 0.1) 0%, rgba(23, 162, 184, 0.1) 100%);

    /* Status Colors */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(7, 37, 64, 0.08), 0 1px 2px rgba(7, 37, 64, 0.04);
    --shadow-md: 0 4px 12px rgba(7, 37, 64, 0.08), 0 2px 4px rgba(7, 37, 64, 0.04);
    --shadow-lg: 0 10px 40px rgba(7, 37, 64, 0.12), 0 4px 12px rgba(7, 37, 64, 0.06);
    --shadow-glow: 0 0 40px rgba(15, 76, 129, 0.15);
    --shadow-card: 0 2px 8px rgba(7, 37, 64, 0.04), 0 1px 2px rgba(7, 37, 64, 0.02);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(26, 26, 38, 0.8);
    --bg-card-hover: rgba(35, 35, 50, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   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;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition-base), color var(--transition-base);
}

/* --------------------------------------------------------------------------
   App Layout
   -------------------------------------------------------------------------- */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header__home-link {
    display: flex;
    align-items: center;
    transition: opacity var(--transition-fast);
}

.header__home-link:hover {
    opacity: 0.8;
}

.header__logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.header__title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header__brand {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.header__actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    transform: rotate(15deg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon-moon {
    display: block;
}

.theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

/* Main Layout */
.main {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex: 1;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    text-decoration: none;
}

.btn--primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--accent {
    background: linear-gradient(135deg, #ff974f 0%, #ffb347 100%);
    color: white;
}

.btn--accent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn--icon:hover {
    background: var(--bg-card);
    color: var(--accent);
}

.btn--lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn--xl {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.125rem;
}

/* --------------------------------------------------------------------------
   Live Preview Sidebar
   -------------------------------------------------------------------------- */
.preview {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    overflow-y: auto;
}

.preview__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.preview__title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.preview__badge {
    font-size: 0.625rem;
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent-gradient);
    color: white;
    border-radius: 100px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview__metrics {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Score Ring */
.score-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    color: white;
}

.score-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-ring__value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.score-ring__label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.score-ring__rating {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Metric Cards */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all var(--transition-spring);
    box-shadow: var(--shadow-card);
}

.metric-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.metric-card__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.metric-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Red Flags */
.red-flags-container {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.red-flag {
    font-size: 0.8125rem;
    color: var(--danger);
    padding: var(--space-xs) 0;
}

/* --------------------------------------------------------------------------
   Wizard Section
   -------------------------------------------------------------------------- */
.wizard {
    padding: var(--space-2xl);
    overflow-y: auto;
    max-width: 800px;
}

/* Step Indicators */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--space-2xl);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    transition: all var(--transition-base);
}

.step__number {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-spring);
    box-shadow: var(--shadow-sm);
}

.step:hover .step__number {
    transform: scale(1.1);
    border-color: var(--accent);
}

.step__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.step--active .step__number {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

.step--active .step__label {
    color: var(--text-primary);
}

.step--completed .step__number {
    background: var(--success);
    border-color: transparent;
    color: white;
}

.step__connector {
    width: 60px;
    height: 3px;
    background: var(--border-color);
    margin: 0 var(--space-sm);
    margin-bottom: 20px;
    border-radius: 2px;
}

.step--completed+.step__connector {
    background: var(--success);
}

/* Wizard Steps Content */
.wizard__step {
    display: none;
    animation: slideIn 0.4s ease;
}

.wizard__step--active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wizard__title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.wizard__subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: var(--space-xl);
}

.wizard__nav {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */
.form-section {
    margin-bottom: var(--space-xl);
}

.form-section__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group--full {
    width: 100%;
}

.form-group--toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.form-group--tristate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.form-label {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-label__value {
    font-weight: 700;
    color: var(--accent);
}

.form-label__hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.form-input {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--transition-base);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-range {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.form-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.form-range__labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-hint--warning {
    color: var(--warning);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle__slider {
    width: 56px;
    height: 28px;
    background: var(--border-color);
    border-radius: 14px;
    position: relative;
    transition: background var(--transition-base);
}

.toggle__slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked+.toggle__slider {
    background: var(--success);
}

.toggle input:checked+.toggle__slider::before {
    transform: translateX(28px);
}

.toggle__label {
    margin-left: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.toggle__label--yes {
    color: var(--success);
    display: none;
}

.toggle__label--no {
    color: var(--text-muted);
}

.toggle input:checked~.toggle__label--yes {
    display: inline;
}

.toggle input:checked~.toggle__label--no {
    display: none;
}

/* Tristate Buttons */
.tristate-buttons {
    display: flex;
    gap: var(--space-sm);
}

.tristate-btn {
    padding: var(--space-sm) var(--space-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.tristate-btn:hover {
    border-color: var(--accent);
}

.tristate-btn--active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Not Sure Button */
.tristate-btn--unsure {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.tristate-btn--unsure.tristate-btn--active {
    background: var(--text-muted);
    border-color: transparent;
    color: white;
}

/* Doing Well Section */
.doing-well {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.doing-well__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: var(--space-md);
}

.doing-well__content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.doing-well__item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    flex: 1 1 calc(50% - var(--space-md));
    min-width: 200px;
    padding: var(--space-sm);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.doing-well__icon {
    color: var(--success);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
}

.doing-well__text {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
}

.doing-well__text strong {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.doing-well__text span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Info Card */
.info-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
}

.info-card__icon {
    font-size: 1.5rem;
}

.info-card__title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.info-card__value {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Results Section
   -------------------------------------------------------------------------- */
.results-hero {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: var(--space-xl);
}

.results-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-sm);
}

.results-score__value {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
}

.results-score__label {
    font-size: 1.5rem;
    opacity: 0.7;
}

.results-rating {
    font-size: 1.25rem;
    margin-top: var(--space-sm);
    font-weight: 600;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
}

.kpi-card__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.kpi-card__value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.kpi-card__context {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Chart Card */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.chart-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.chart-card canvas {
    max-height: 250px;
}

/* Recommendations */
.recommendations {
    margin-bottom: var(--space-xl);
}

.recommendations__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.rec-section {
    margin-bottom: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.rec-section__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.rec-section__icon {
    font-size: 1.25rem;
}

.rec-section__title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.rec-section__content {
    padding: var(--space-md);
}

.rec-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.rec-item:last-child {
    border-bottom: none;
}

.rec-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.rec-item__title {
    font-weight: 600;
    color: var(--text-primary);
}

.rec-item__impact {
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
    text-transform: uppercase;
}

.rec-item__impact--critical {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.rec-item__impact--high {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.rec-item__impact--medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.rec-item__impact--low {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.rec-item__badges {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.rec-item__difficulty {
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
    text-transform: uppercase;
}

.rec-item__difficulty--easy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.rec-item__difficulty--medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.rec-item__difficulty--hard {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.rec-item__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.rec-item__value {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: 1px dashed var(--border-color);
}

.rec-item__value strong {
    color: var(--success);
}

.rec-empty {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Methodology Note */
.methodology-note {
    margin-top: var(--space-xl);
    padding: var(--space-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

.methodology-note a {
    color: var(--accent);
    text-decoration: none;
}

.methodology-note a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 1000;
}

.modal-overlay--active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal__close:hover {
    color: var(--text-primary);
}

.modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.modal__subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.modal__disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-md);
    text-align: center;
}

/* Success State */
.modal__success {
    text-align: center;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.success-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.success-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.success-cta {
    background: var(--accent-gradient-soft);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.success-cta__text {
    font-weight: 500;
    margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
    }

    .preview {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: 180px;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 90;
        padding: var(--space-md);
        flex-direction: row;
        gap: var(--space-md);
        overflow-x: auto;
    }

    .preview__header {
        display: none;
    }

    .preview__metrics {
        flex-direction: row;
        gap: var(--space-sm);
    }

    .score-ring-container {
        min-width: 120px;
        padding: var(--space-md);
    }

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

    .metric-card {
        min-width: 100px;
        padding: var(--space-sm) var(--space-md);
    }

    .metric-card__value {
        font-size: 1.25rem;
    }

    .wizard {
        padding: var(--space-lg);
        padding-bottom: 200px;
    }

    .red-flags-container {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-score__value {
        font-size: 4rem;
    }

    .wizard__title {
        font-size: 1.5rem;
    }

    .steps {
        gap: 0;
    }

    .step__connector {
        width: 30px;
    }

    .step__label {
        display: none;
    }

    .form-group--toggle {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group--tristate {
        flex-direction: column;
        align-items: flex-start;
    }

    .export-actions {
        flex-direction: column;
    }

    .export-actions .btn {
        width: 100%;
    }

    .header {
        padding: var(--space-sm) var(--space-md);
    }

    .header__actions .btn span {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   SEO Content Section
   -------------------------------------------------------------------------- */
.seo-content {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-primary);
}

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

.seo-section {
    margin-bottom: var(--space-2xl);
}

.seo-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    text-align: center;
}

.seo-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.seo-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.seo-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: var(--space-lg);
}

.seo-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.seo-list li::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 8px;
}

/* Methodology Grid */
.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.method-card {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.method-card__percent {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
    margin-bottom: var(--space-xs);
}

.method-card__title {
    font-weight: 700;
    margin-bottom: var(--space-xs);
    display: block;
}

.method-card__desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* FAQ Accordion */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: var(--transition-base);
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.faq-question {
    width: 100%;
    padding: var(--space-lg);
    text-align: left;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent);
    transition: var(--transition-base);
}

.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--space-lg) var(--space-lg);
    color: var(--text-secondary);
    line-height: 1.6;
    display: none;
}

.faq-item[open] .faq-answer {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer (Small) */
.seo-footer {
    text-align: center;
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-2xl);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.seo-footer a {
    color: var(--accent);
    text-decoration: none;
}

.seo-footer a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   FAQ & Methodology Modals (Adopted from ROI Calculator)
   -------------------------------------------------------------------------- */
.btn--icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn--icon:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

.btn--icon svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn__icon-text {
    line-height: 1;
}

.faq-modal,
.methodology-modal {
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    /* Ensure it overrides default modal width if needed, or works with it */
    width: 90%;
}

.faq-modal__content,
.methodology-modal__content {
    margin-top: var(--space-lg);
    overflow-y: auto;
    max-height: 60vh;
    padding-right: var(--space-sm);
}

/* Centered modal title */
.faq-modal .modal__title,
.methodology-modal .modal__title {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.faq__item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.faq__question {
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9375rem;
}

.faq__question::-webkit-details-marker {
    display: none;
}

.faq__question::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--accent);
    transition: transform var(--transition-fast);
}

details[open] .faq__question::after {
    content: '−';
}

.faq__answer {
    padding: 0 var(--space-lg) var(--space-md);
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.875rem;
}

/* Methodology Sections */
.methodology-section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.methodology-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.methodology-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.methodology-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.methodology-section ul {
    padding-left: var(--space-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.8;
}

.methodology-section ul li {
    margin-bottom: var(--space-xs);
}

.methodology-section ul li strong {
    color: var(--text-primary);
}

.methodology-section--sources {
    background: var(--accent-gradient-soft);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border-bottom: none;
}

.methodology-section--sources h3 {
    color: var(--accent);
}

.methodology-section--sources p {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Scoring Breakdown (Expandable Details)
   -------------------------------------------------------------------------- */
.score-breakdown {
    margin-bottom: var(--space-xl);
}

.score-breakdown__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

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

/* Breakdown Card */
.breakdown-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.breakdown-card[open] {
    box-shadow: var(--shadow-md);
}

.breakdown-card--good {
    border-left: 4px solid var(--success);
}

.breakdown-card--warn {
    border-left: 4px solid var(--warning);
}

.breakdown-card--critical {
    border-left: 4px solid var(--danger);
}

.breakdown-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    cursor: pointer;
    list-style: none;
}

.breakdown-card__header::-webkit-details-marker {
    display: none;
}

.breakdown-card__header::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.breakdown-card[open] .breakdown-card__header::after {
    content: '−';
}

.breakdown-card__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.breakdown-card__info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.breakdown-card__label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.breakdown-card__context {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.breakdown-card__stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.breakdown-card__score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.breakdown-card--good .breakdown-card__score {
    color: var(--success);
}

.breakdown-card--warn .breakdown-card__score {
    color: var(--warning);
}

.breakdown-card--critical .breakdown-card__score {
    color: var(--danger);
}

.breakdown-card__delta {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.breakdown-card__delta--above {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.breakdown-card__delta--below {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Breakdown Body */
.breakdown-card__body {
    padding: 0 var(--space-md) var(--space-md);
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.breakdown-card__weight {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: var(--space-sm) 0;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: var(--space-sm);
}

.breakdown-card__penalties {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* Penalty Items */
.penalty-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.penalty-item--warning {
    background: rgba(245, 158, 11, 0.1);
}

.penalty-item--critical {
    background: rgba(239, 68, 68, 0.1);
}

.penalty-item__impact {
    font-weight: 700;
    min-width: 36px;
}

.penalty-item--warning .penalty-item__impact {
    color: var(--warning);
}

.penalty-item--critical .penalty-item__impact {
    color: var(--danger);
}

.penalty-item__text {
    color: var(--text-secondary);
}

.penalty-empty {
    font-size: 0.8125rem;
    color: var(--success);
    padding: var(--space-xs) 0;
}

/* ==========================================
   Mobile & Accessibility Hardening Layer
   ========================================== */

/* Touch Targets (WCAG 2.1 Target Size) */
.theme-toggle,
.btn--icon,
button,
select,
input[type="text"],
input[type="email"],
input[type="number"],
.form-control,
.btn {
    min-height: 44px;
    /* Accessible touch target */
}

/* Fix iOS Input Zoom & Tap Area */
@media (max-width: 768px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevents auto-zoom on iOS */
    }
}

/* Range Sliders Touch Area */
input[type=range]::-webkit-slider-thumb {
    width: 44px;
    height: 44px;
    cursor: pointer;
    margin-top: -20px;
    /* Center thumb */
}

input[type=range]::-moz-range-thumb {
    width: 44px;
    height: 44px;
    cursor: pointer;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}