/* --- CSS VARIABLES (Sync from Landing Page) --- */
:root {
    --bg-cream: #f1ecd9;
    --bg-slate: #36517c;
    --text-dark: #111111;
    --text-light: #ffffff;
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background-color: var(--bg-cream); /* Smooth cream background */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(244, 242, 234, 0.90);
    backdrop-filter: blur(8px);
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-name {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-dark);
}

.back-link {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    padding: 0.7rem 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: #a7f3d0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* --- MAIN CONTAINER --- */
.app-container {
    padding: 8rem 5% 4rem 5%; /* Top padding accounts for floating navbar */
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* --- WIZARD STEPS --- */
.wizard-step {
    display: none; /* Hidden by default */
    animation: fadeIn 0.4s ease-in-out forwards;
}

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

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

/* --- CARD STYLE (inherited from .service-card / .impact) --- */
.service-card {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.card-header h3 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--bg-slate);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-cream);
}

/* --- TYPOGRAPHY & INSTRUCTIONS --- */
.instruction-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 2rem;
}

/* --- FORM ELEMENTS --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bg-slate);
}

.form-group input[type="number"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--bg-cream);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--bg-slate);
}

.input-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-row .form-group {
    flex: 1;
}

/* --- FILE UPLOAD --- */
.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #f8f9fa;
    border: 2px dashed #cbd5e1;
    padding: 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    background-color: var(--bg-cream);
    border-color: var(--bg-slate);
}

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

input[type="file"] {
    display: none;
}

/* --- ERROR BANNER --- */
.error-banner {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

/* --- BUTTONS --- */
.service-btn {
    display: inline-block;
    background: #111;
    color: #fff;
    padding: 1rem 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.service-btn:hover {
    background: #374151;
}

.service-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--bg-slate);
    padding: 1rem 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--bg-slate);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--bg-slate);
    color: #fff;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* --- CONFIG TABLE --- */
.config-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
}

.config-table th {
    position: sticky;
    top: 0;
    background-color: var(--bg-slate);
    color: #fff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    z-index: 10;
}

.config-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.config-table tr:hover {
    background-color: #f8f9fa;
}

/* Custom Radio styles */
input[type="radio"] {
    transform: scale(1.2);
    cursor: pointer;
    accent-color: var(--bg-slate);
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-cream);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

/* --- TABLES COMPARISON --- */
.tables-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
}

.chart-container {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.chart-container h3 {
    text-align: center;
    font-size: 1.2rem;
    color: var(--bg-slate);
    margin-bottom: 0.5rem;
}

.chart-note {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1.5rem;
    font-style: italic;
    display: block;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table th, .result-table td {
    padding: 0.8rem;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}

.result-table th {
    font-weight: 600;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .tables-container {
        grid-template-columns: 1fr;
    }
    .input-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* --- MODAL POP-UP --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #ffffff;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: translateY(0);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 1.2rem 1.5rem;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    border-bottom: 1px solid #fecaca;
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
    color: #444;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
    text-align: right;
    border-top: 1px solid #e5e7eb;
}
