/* ==========================================================
   FACESCORE DESIGN SYSTEM
   Mobile-first, refined, professional wellness UI
   ========================================================== */

/* ---------- CSS Variables ---------- */
:root {
    /* Colors - Warm Neutral Palette */
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #5C5C5C;
    --color-text-muted: #8A8A8A;

    --color-btn-primary: #2D3436;
    --color-btn-primary-hover: #1E2628;
    --color-btn-primary-text: #FFFFFF;

    --color-btn-secondary: transparent;
    --color-btn-secondary-border: #D1CCC6;
    --color-btn-secondary-text: #2D3436;

    --color-accent: #5A7D7C;
    --color-positive: #3D9970;
    --color-negative: #C0392B;

    --color-bg: #FEFDFB;
    --color-bg-alt: #F7F5F2;
    --color-card-bg: #FFFFFF;
    --color-border: #E8E5E1;

    /* Spacing (4px base, consistent scale) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Legacy spacing aliases for compatibility */
    --space-xs: var(--space-2);
    --space-s: var(--space-4);
    --space-m: var(--space-6);
    --space-l: var(--space-8);
    --space-xl: var(--space-12);

    /* Typography */
    --font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-base: 15px;
    --font-size-small: 13px;
    --font-size-muted: 12px;
    --font-size-h1: 26px;
    --font-size-h2: 20px;
    --font-size-h3: 17px;

    /* Borders */
    --radius-button: 8px;
    --radius-card: 10px;
    --radius-small: 6px;

    /* Button */
    --btn-height: 46px;

    /* Shadows */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

html {
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile browser chrome */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout ---------- */
.app-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: var(--space-m);
    padding-bottom: 0;
    /* Remove bottom padding, step-actions handles it */
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile browser chrome */
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */
.header {
    text-align: center;
    margin-bottom: var(--space-l);
    padding-top: var(--space-s);
}

.header-logo {
    font-size: var(--font-size-h2);
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

/* ---------- Typography ---------- */
h1 {
    font-size: var(--font-size-h1);
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text-primary);
    margin-bottom: var(--space-s);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-size-h2);
    font-weight: 500;
    line-height: 1.3;
    color: var(--color-text-primary);
    margin-bottom: var(--space-s);
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
}

.subtext {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-m);
}

.helper-text {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.muted-text {
    font-size: var(--font-size-muted);
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn {
    display: block;
    width: 100%;
    height: var(--btn-height);
    border: none;
    border-radius: var(--radius-button);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.btn-primary {
    background-color: var(--color-btn-primary);
    color: var(--color-btn-primary-text);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background-color: var(--color-btn-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.btn-primary:disabled {
    background-color: var(--color-bg-alt);
    color: var(--color-text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

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

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

/* ---------- Cards ---------- */
.card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

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

/* ---------- Scan Features (Step 1) ---------- */
.scan-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-m);
    padding: var(--space-4);
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-card);
    border: 1px solid var(--color-border);
}

.scan-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.feature-icon {
    color: var(--color-positive);
    font-weight: 600;
    font-size: 14px;
}

.feature-text {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
}

/* ---------- Consent Checkbox ---------- */
.consent-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    cursor: pointer;
    user-select: none;
    padding: var(--space-2) 0;
    /* Larger tap area */
}

.consent-checkbox input {
    display: none;
}

.consent-checkbox .checkmark {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-small);
    background-color: var(--color-card-bg);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.consent-checkbox input:checked+.checkmark {
    background-color: var(--color-btn-primary);
    border-color: var(--color-btn-primary);
}

.consent-checkbox input:checked+.checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.consent-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.consent-text a {
    color: var(--color-text-secondary);
    text-decoration: underline;
}

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

/* ---------- Steps ---------- */
.step,
.step-2-5 {
    display: none;
    flex-direction: column;
    flex: 1;
    /* Allow content to scroll while keeping button fixed */
    min-height: 0;
}

.step.active,
.step-2-5.active {
    display: flex;
}

.step-content {
    flex: 1;
    overflow-y: auto;
    /* Add padding to prevent content from being hidden behind sticky button */
    padding-bottom: var(--space-4);
}

.step-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-4) 0;
    padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
    /* Handle iPhone notch/home bar */
    background-color: var(--color-bg);
    margin-top: auto;
    /* Subtle top border to separate from content */
    border-top: 1px solid transparent;
    /* Fade effect at top */
    background-image: linear-gradient(to bottom, transparent, var(--color-bg) 8px);
    background-position: top;
    background-size: 100% 8px;
    background-repeat: no-repeat;
    z-index: 10;
}

/* ---------- Upload Area (Step 2) ---------- */
.upload-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    height: 56px;
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 400;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.upload-btn:hover {
    background-color: var(--color-border);
    border-color: var(--color-text-muted);
}

.upload-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-text-secondary);
}

/* Photo Preview */
.photo-preview {
    margin-top: var(--space-s);
    text-align: center;
}

.photo-thumbnails {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-xs);
}

.photo-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-small);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Loading (Step 2.5) ---------- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) 0;
    flex: 1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-btn-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-m);
}

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

.loading-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

/* ---------- Results (Step 3) ---------- */
.results-section {
    margin-bottom: var(--space-s);
}

.results-section:last-of-type {
    margin-bottom: 0;
}

.results-label {
    font-size: var(--font-size-small);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.results-list {
    list-style: none;
}

.results-list li {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    padding: 6px 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
}

.results-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
}

.results-list.positives li::before {
    background-color: var(--color-positive);
}

.results-list.blockers li::before {
    background-color: var(--color-negative);
}

/* Main Limiter - Inside Card */
.main-limiter-section {
    margin-top: var(--space-s);
    padding-top: var(--space-s);
    border-top: 1px solid var(--color-border);
}

.limiter-text {
    font-size: var(--font-size-h3);
    font-weight: 500;
    color: var(--color-text-primary);
    line-height: 1.4;
    margin: 0;
}

/* ---------- Score (Step 4) ---------- */
.score-container {
    display: flex;
    gap: var(--space-s);
}

.score-block {
    flex: 1;
    text-align: center;
    padding: var(--space-m) var(--space-s);
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-card);
    border: 1px solid var(--color-border);
}

.score-label {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.score-value {
    font-size: 36px;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.score-block.potential .score-value {
    color: #33996b;
}

.score-disclaimer {
    margin-top: var(--space-m);
    text-align: center;
}

/* ---------- Path Cards (Step 5) ---------- */
.path-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

.path-card {
    padding: var(--space-s) var(--space-5);
    background-color: var(--color-card-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-card);
}

.path-card:hover {
    border-color: var(--color-text-muted);
    box-shadow: var(--shadow-card-hover);
}

.path-card.selected {
    border-color: var(--color-btn-primary);
}

.path-card.highlighted {
    position: relative;
}

.path-card.highlighted::before {
    content: 'Most chosen';
    position: absolute;
    top: -10px;
    left: var(--space-s);
    background-color: var(--color-accent);
    color: white;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.path-name {
    font-size: var(--font-size-h3);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.path-description {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.path-effort {
    font-size: var(--font-size-muted);
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.path-price {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ---------- Offer Preview (Step 6) ---------- */
.offer-list {
    list-style: none;
    margin-bottom: var(--space-m);
}

.offer-list li {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    padding: var(--space-xs) 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
}

.offer-list li::before {
    content: '✓';
    color: var(--color-positive);
    font-weight: 600;
}

/* ---------- Checkout (Step 7) ---------- */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-label {
    font-size: var(--font-size-small);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-input {
    height: 46px;
    padding: 0 var(--space-s);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    background-color: var(--color-card-bg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-btn-primary);
    box-shadow: 0 0 0 3px rgba(45, 52, 54, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.payment-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    flex-wrap: wrap;
}

.payment-icons svg {
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.payment-icons svg:hover {
    opacity: 1;
}

/* ---------- Thank You (Step 8) ---------- */
.thank-you-content {
    text-align: center;
    padding: var(--space-xl) 0;
}

.thank-you-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-m);
    background-color: var(--color-positive);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thank-you-icon svg {
    width: 32px;
    height: 32px;
    stroke: white;
    stroke-width: 3;
}

/* ---------- Desktop Breakpoint ---------- */
@media (min-width: 768px) {
    .app-container {
        max-width: 520px;
        padding: var(--space-xl) var(--space-l);
        padding-bottom: 0;
    }

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

    .step-actions {
        padding: var(--space-l) 0;
        padding-bottom: var(--space-l);
    }

    .btn {
        max-width: 320px;
        margin: 0 auto;
    }

    .score-container {
        gap: var(--space-m);
    }

    .score-block {
        padding: var(--space-l) var(--space-m);
    }

    .score-value {
        font-size: 44px;
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 600px;
    }
}

/* ---------- Blurred Dashboard Preview (Step 4.5) ---------- */
.step-4-5 {
    display: none;
    flex-direction: column;
    flex: 1;
}

.step-4-5.active {
    display: flex;
}

.preview-dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Preview Tab Bar */
.preview-tab-bar {
    display: flex;
    gap: var(--space-1);
    background-color: var(--color-bg-alt);
    padding: var(--space-1);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-4);
}

.preview-tab {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-small);
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.preview-tab.active {
    background-color: var(--color-card-bg);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-card);
}

/* Preview Panels */
.preview-panel {
    display: none;
    flex: 1;
}

.preview-panel.active {
    display: block;
}

/* Content Wrapper with Blur */
.preview-content-wrapper {
    position: relative;
    min-height: 300px;
}

.preview-blurred-content {
    filter: blur(6px);
    opacity: 0.7;
    user-select: none;
    pointer-events: none;
}

/* Unlock Overlay */
.preview-unlock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(254, 253, 251, 0.4);
}

.preview-unlock-btn {
    padding: var(--space-3) var(--space-6);
    background-color: var(--color-btn-primary);
    color: var(--color-btn-primary-text);
    border: none;
    border-radius: var(--radius-button);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-button), 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.preview-unlock-btn:hover {
    background-color: var(--color-btn-primary-hover);
    transform: translateY(-1px);
}

/* Preview Day Header */
.preview-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.preview-day-title {
    font-size: var(--font-size-h3);
    font-weight: 500;
    color: var(--color-text-primary);
}

.preview-progress {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
}

/* Preview Task Section */
.preview-task-section {
    margin-bottom: var(--space-4);
}

.preview-section-title {
    font-size: var(--font-size-small);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-2);
}

.preview-task-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    margin-bottom: var(--space-2);
}

.preview-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    flex-shrink: 0;
}

.preview-task-text {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
}

/* Preview Roadmap */
.preview-roadmap-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.preview-roadmap-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-border);
    flex-shrink: 0;
    margin-top: 4px;
}

.preview-roadmap-dot.active {
    background-color: var(--color-accent);
}

.preview-roadmap-content {
    flex: 1;
}

.preview-duration {
    display: block;
    font-size: var(--font-size-small);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.preview-benefit {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Preview Exercise Cards */
.preview-exercise-card {
    padding: var(--space-4);
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-3);
}

.preview-exercise-name {
    font-size: var(--font-size-h3);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.preview-exercise-desc {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
}

/* Preview Exercise with Thumbnails */
.preview-exercise-card {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-3);
}

.preview-exercise-thumb {
    position: relative;
    width: 100px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-small);
    overflow: hidden;
}

.preview-exercise-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.preview-exercise-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Preview Product Cards */
.preview-product-card {
    padding: var(--space-4);
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-3);
}

.preview-product-name {
    font-size: var(--font-size-h3);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.preview-product-why {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.preview-product-tag {
    display: inline-block;
    font-size: var(--font-size-muted);
    font-weight: 500;
    color: var(--color-accent);
    background-color: rgba(90, 125, 124, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Preview Today Header (Unblurred) */
.preview-today-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3);
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-4);
}

.preview-today-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-day-label {
    font-size: var(--font-size-h3);
    font-weight: 500;
    color: var(--color-text-primary);
}

.preview-progress-text {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
}

.preview-start-btn {
    padding: var(--space-2) var(--space-4);
}

/* Preview Section (Morning/Evening) */
.preview-section {
    margin-bottom: var(--space-4);
}

.preview-section-header {
    font-size: var(--font-size-small);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-2);
}

.preview-section-content-wrapper {
    position: relative;
    min-height: 120px;
}

/* ========== Legal Footer ========== */
.legal-footer {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    margin-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.legal-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}

.legal-footer-links .legal-link {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.legal-footer-links .legal-link:hover {
    color: var(--color-text-primary);
    text-decoration: underline;
}

.legal-divider {
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
}

.legal-copyright {
    font-size: var(--font-size-muted);
    color: var(--color-text-muted);
}

/* Ensure footer is always below fold (requires scroll) */
body {
    min-height: calc(100vh + 1px);
}

/* ========== Legal Popup Modal ========== */
.legal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: 9999;
}

.legal-modal-overlay.active {
    display: flex;
}

.legal-modal {
    background-color: var(--color-card-bg);
    border-radius: var(--radius-card);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.legal-modal-header h2 {
    font-size: var(--font-size-h3);
    font-weight: 600;
    margin: 0;
}

.legal-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.legal-modal-close:hover {
    background-color: var(--color-bg-alt);
}

.legal-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-text-secondary);
}

.legal-modal-content {
    padding: var(--space-5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Legal content typography */
.legal-modal-content h3 {
    font-size: var(--font-size-h2);
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
}

.legal-modal-content h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.legal-modal-content p {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-3);
}

.legal-modal-content ul {
    list-style: disc;
    padding-left: var(--space-5);
    margin-bottom: var(--space-3);
}

.legal-modal-content ul li {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-1);
}

.legal-modal-content a {
    color: var(--color-accent);
    text-decoration: underline;
}

.legal-modal-content a:hover {
    color: var(--color-text-primary);
}

/* Mobile adjustments for legal modal */
@media (max-width: 480px) {
    .legal-modal {
        max-height: 90vh;
        border-radius: var(--radius-card) var(--radius-card) 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .legal-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
}