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

:root {
    --color-primary: #1a3a5c;
    --color-primary-light: #2c5f8a;
    --color-accent: #e85d04;
    --color-critical: #d00000;
    --color-critical-bg: #fff0f0;
    --color-document: #b45309;
    --color-document-bg: #fffbeb;
    --color-cleanup: #15803d;
    --color-cleanup-bg: #f0fdf4;
    --color-professional: #1d4ed8;
    --color-professional-bg: #eff6ff;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #f9fafb;
    --color-white: #ffffff;
    --color-border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

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

/* Header */
.site-header {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 24px 0;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title .icon {
    flex-shrink: 0;
}

.site-tagline {
    margin-top: 4px;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Main Content */
main {
    padding: 24px 0 48px;
}

/* Alert Boxes */
.alert-box {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.alert-critical {
    background: var(--color-critical-bg);
    border-left: 4px solid var(--color-critical);
}

.alert-box .icon {
    flex-shrink: 0;
    color: var(--color-critical);
}

/* Section Styles */
section {
    margin-bottom: 32px;
}

h2 {
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Progress Bar */
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin-bottom: 0;
}

.progress-bar {
    flex: 1;
    min-width: 150px;
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

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

/* Checklist Groups */
.checklist-group {
    margin-bottom: 24px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.group-header {
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.group-critical {
    background: var(--color-critical-bg);
    color: var(--color-critical);
}

.group-critical .group-icon {
    background: var(--color-critical);
}

.group-document {
    background: var(--color-document-bg);
    color: var(--color-document);
}

.group-document .group-icon {
    background: var(--color-document);
}

.group-cleanup {
    background: var(--color-cleanup-bg);
    color: var(--color-cleanup);
}

.group-cleanup .group-icon {
    background: var(--color-cleanup);
}

.group-professional {
    background: var(--color-professional-bg);
    color: var(--color-professional);
}

.group-professional .group-icon {
    background: var(--color-professional);
}

/* Checklist Items */
.checklist {
    list-style: none;
    padding: 8px 0;
}

.checklist-item {
    border-bottom: 1px solid var(--color-border);
}

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

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background var(--transition);
}

.checkbox-label:hover {
    background: var(--color-bg);
}

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

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    margin-top: 2px;
}

.checkbox-label input:checked + .checkmark {
    background: var(--color-cleanup);
    border-color: var(--color-cleanup);
}

.checkbox-label input:checked + .checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-label input:checked ~ .item-text {
    text-decoration: line-through;
    opacity: 0.7;
}

.item-text {
    flex: 1;
    line-height: 1.5;
}

/* Cost Grid */
.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.cost-card {
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.cost-card h4 {
    color: var(--color-primary);
    margin-bottom: 8px;
}

.cost-range {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 8px;
}

.cost-desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Mistake List */
.mistake-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.mistake-item {
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-accent);
}

.mistake-item h4 {
    color: var(--color-accent);
    margin-bottom: 8px;
}

.mistake-item p {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

/* FAQ */
.faq-list {
    margin-top: 16px;
}

.faq-item {
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.faq-item dt {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.faq-item dd {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* Prevention List */
.prevention-list {
    list-style: none;
    margin-top: 16px;
}

.prevention-list li {
    position: relative;
    padding: 12px 0 12px 28px;
    border-bottom: 1px solid var(--color-border);
}

.prevention-list li:last-child {
    border-bottom: none;
}

.prevention-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    width: 16px;
    height: 16px;
    background: var(--color-cleanup);
    border-radius: 50%;
}

.prevention-list li::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 22px;
    width: 5px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Section Note */
.section-note {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

/* Footer */
.site-footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 32px 0;
    text-align: center;
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--color-white);
    text-decoration: none;
    opacity: 0.9;
}

.site-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.version-info {
    margin-top: 16px;
    opacity: 0.7;
    font-size: 0.8rem;
}

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

/* Print Styles */
@media print {
    body {
        background: white;
        font-size: 12pt;
    }
    
    .site-header {
        background: white;
        color: black;
        padding: 16px 0;
    }
    
    .site-title {
        color: black;
    }
    
    .action-buttons,
    .site-footer,
    .progress-bar,
    .progress-text {
        display: none;
    }
    
    .checklist-group {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .checkmark {
        border: 2px solid #666;
    }
    
    .checkbox-label input:checked + .checkmark {
        background: #666;
    }
    
    section {
        break-inside: avoid;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .cost-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.checkbox-label:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
