/* ============================================
   Curing Salt Calculator v5 — Complete Styles
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-input: #ffffff;
    --bg-code: #f4f4f8;

    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-tertiary: #6b7280;
    --text-inverse: #ffffff;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --accent-lighter: #eff6ff;

    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;

    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

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

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

    --header-height: 70px;
    --container-max: 1200px;
    --transition: 0.2s ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1a1a2e;
    --bg-card-hover: #16213e;
    --bg-input: #16213e;
    --bg-code: #16213e;

    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --text-inverse: #1a1a2e;

    --accent: #60a5fa;
    --accent-hover: #93bbfd;
    --accent-light: #1e3a5f;
    --accent-lighter: #0f2744;

    --success: #34d399;
    --success-light: #064e3b;
    --warning: #fbbf24;
    --warning-light: #451a03;
    --danger: #f87171;
    --danger-light: #450a0a;

    --border: #2d3748;
    --border-light: #1a202c;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    z-index: 10000;
    font-weight: 600;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 10px;
}

/* ========== HEADER ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: all var(--transition);
}

[data-theme="dark"] .site-header {
    background: rgba(15,15,26,0.9);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

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

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun,
.icon-sun { display: none; }
[data-theme="light"] .icon-moon,
.icon-moon { display: block; }

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    z-index: 999;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-lg);
}

.mobile-menu.active {
    display: flex;
}

.mobile-link {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    transition: background var(--transition);
}

.mobile-link:hover {
    background: var(--bg-tertiary);
}

/* ========== HERO ========== */
.hero {
    position: relative;
    padding: calc(var(--header-height) + 60px) 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, var(--accent-lighter) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(37,99,235,0.05) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--success-light);
    color: var(--success);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.hero-subtitle-line {
    display: block;
    font-size: 0.55em;
    font-weight: 600;
    color: var(--accent);
    margin-top: 8px;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 20px auto 32px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.hero-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.4);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-lighter);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ========== SECTIONS ========== */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========== CALCULATOR ========== */
.calculator-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.calculator-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    max-width: 900px;
    margin: 0 auto;
}

/* Progress Steps */
.calc-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 0 20px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.progress-step.active .step-num,
.progress-step.completed .step-num {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.progress-step.completed .step-num {
    background: var(--success);
    border-color: var(--success);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

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

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    margin-bottom: 20px;
    max-width: 60px;
}

/* Calculator Steps */
.calc-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.calc-step.active {
    display: block;
}

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

.step-header {
    margin-bottom: 28px;
}

.step-header h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Controls */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

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

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition);
    width: 100%;
}

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

.form-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

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

/* Input with Unit */
.input-with-unit {
    display: flex;
    gap: 0;
}

.input-with-unit .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.unit-select {
    padding: 12px 12px;
    border: 1.5px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 70px;
}

/* Preset Buttons */
.range-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.preset-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.preset-btn:hover,
.preset-btn.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

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

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    font-size: 0.9rem;
}

.radio-label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-lighter);
    color: var(--accent);
}

.radio-label input[type="radio"] {
    accent-color: var(--accent);
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* ========== RESULTS PANEL ========== */
.results-panel {
    animation: slideUp 0.5s ease;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid var(--border-light);
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h3 {
    font-size: 1.3rem;
}

.results-actions {
    display: flex;
    gap: 8px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
}

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

.result-card.primary {
    background: var(--accent-lighter);
    border-color: var(--accent);
}

.result-icon {
    font-size: 1.8rem;
}

.result-content {
    display: flex;
    flex-direction: column;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.result-unit {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Math Breakdown */
.math-breakdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.breakdown-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background var(--transition);
}

.breakdown-header:hover {
    background: var(--bg-tertiary);
}

.breakdown-header h4 {
    font-size: 1rem;
}

.chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
    color: var(--text-tertiary);
}

.math-breakdown.open .chevron {
    transform: rotate(180deg);
}

.breakdown-content {
    display: none;
    padding: 0 24px 24px;
}

.math-breakdown.open .breakdown-content {
    display: block;
}

.math-steps {
    background: var(--bg-code);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 2;
    overflow-x: auto;
}

.math-step {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.math-step:last-child {
    border-bottom: none;
    font-weight: 700;
    color: var(--accent);
}

.math-step-label {
    color: var(--text-secondary);
}

.math-step-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* PPM Gauge */
.ppm-gauge {
    padding: 16px 0;
}

.gauge-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.gauge-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    position: relative;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1s ease, background 0.3s;
    background: var(--success);
}

.gauge-fill.warning {
    background: var(--warning);
}

.gauge-fill.danger {
    background: var(--danger);
}

.gauge-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    background: var(--danger);
    border-radius: 2px;
    transition: left 0.5s ease;
}

.gauge-status {
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.gauge-status.safe {
    background: var(--success-light);
    color: var(--success);
}

.gauge-status.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.gauge-status.danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Safety Notice */
.safety-notice {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    color: var(--warning);
    font-size: 0.9rem;
    align-items: flex-start;
}

.safety-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ========== TOOLS SECTION ========== */
.tools-section {
    padding: 80px 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition);
}

.tool-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tool-result {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.convert-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ========== HOW IT WORKS ========== */
.how-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.how-step {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    transition: all var(--transition);
}

.how-step:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.step-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-light);
    line-height: 1;
    margin-bottom: 12px;
}

[data-theme="dark"] .step-number {
    color: var(--accent-light);
    opacity: 0.5;
}

.how-step h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.how-step p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== FEATURES ========== */
.features-section {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 28px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== GUIDE ========== */
.guide-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.guide-article {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.guide-article h3 {
    font-size: 1.3rem;
    margin-top: 32px;
    margin-bottom: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.guide-article h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.guide-article p {
    margin-bottom: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.warning-box {
    display: flex;
    gap: 14px;
    padding: 20px;
    background: var(--danger-light);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    margin-top: 24px;
    color: var(--danger);
}

.warning-box svg {
    flex-shrink: 0;
}

/* ========== SAFETY ========== */
.safety-section {
    padding: 80px 0;
}

.safety-warning {
    display: flex;
    gap: 14px;
    padding: 20px 24px;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    color: var(--warning);
    margin-bottom: 32px;
    font-size: 0.95rem;
    line-height: 1.6;
    align-items: flex-start;
}

.safety-warning svg {
    flex-shrink: 0;
    margin-top: 3px;
}

.reference-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.ref-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.ref-card h4 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.ref-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.ref-badge.safe {
    background: var(--success-light);
    color: var(--success);
}

.ref-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.ref-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.sources-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.sources-intro {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.source-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    color: var(--text-primary);
}

.source-link:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.source-info strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.source-info span {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.source-link svg {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

/* ========== FAQ ========== */
.faq-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition);
}

.faq-item:hover {
    border-color: var(--border);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    font-family: var(--font-sans);
    gap: 12px;
}

.faq-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.3s;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 24px 20px;
}

.faq-answer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 10px;
}

.faq-answer ul {
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.faq-answer li {
    margin-bottom: 6px;
}

/* ========== COMPARISON TABLE ========== */
.comparison-section {
    padding: 80px 0;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ref-table th {
    background: var(--bg-tertiary);
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.ref-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.ref-table tr:last-child td {
    border-bottom: none;
}

.ref-table tr:hover td {
    background: var(--bg-secondary);
}

/* ========== ABOUT ========== */
.about-section {
    padding: 60px 0;
    background: var(--bg-secondary);
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    margin-bottom: 16px;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.7;
}

.about-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

/* ========== FOOTER ========== */
.site-footer {
    padding: 60px 0 30px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 12px;
    line-height: 1.6;
}

.footer-links h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 4px 0;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

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

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 36px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 16px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.7;
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-xl);
    z-index: 10001;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        padding: calc(var(--header-height) + 40px) 0 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .calculator-wrapper {
        padding: 24px 16px;
    }

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

    .calc-progress {
        padding: 0;
    }

    .step-label {
        display: none;
    }

    .progress-line {
        max-width: 40px;
    }

    .results-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .reference-cards {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .results-actions {
        width: 100%;
        justify-content: center;
    }

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

    .step-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

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

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .site-header, .hero, .tools-section, .how-section, .features-section,
    .guide-section, .safety-section, .faq-section, .comparison-section,
    .about-section, .site-footer, .back-to-top, .theme-toggle,
    .nav-links, .mobile-menu-btn, .step-actions, .results-actions, .preset-panel, .mc-presets,
    .calc-progress {
        display: none !important;
    }

    .calculator-section {
        padding: 0;
        background: white;
    }

    .calculator-wrapper {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .results-panel {
        display: block !important;
        border-top: 2px solid #000;
    }

    .math-breakdown .breakdown-content {
        display: block !important;
    }

    body {
        color: black;
        background: white;
    }
}