/* style.css - The Design System */
:root {
    /* Default Theme (Dashboard) */
    --primary: #0f172a;       /* Dark Text */
    --primary-light: #334155; 
    --accent: #0d9488;        /* Teal Action Color */
    --accent-hover: #0f766e;
    --bg: #f8fafc;            /* Light Background */
    --surface: #ffffff;       /* Card Background */
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;           
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER --- */
header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.03em;
    line-height: 1.2; /* Allows wrapping on tiny screens */
}

.logo svg { height: 28px; width: 28px; color: var(--accent); flex-shrink: 0; }

/* --- MAIN LAYOUT --- */
main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}

/* Typography */
h1 { color: var(--primary); margin-bottom: 0.5rem; letter-spacing: -0.02em; font-size: 2.2rem; }
p { color: var(--text-muted); font-size: 1.05rem; }

/* Panels & Cards */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
@media(max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

label { display: block; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }

input, select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    background: #fff;
    transition: border-color 0.2s;
}

input:focus, select:focus { outline: none; border-color: var(--accent); }

button.primary-btn {
    width: 100%;
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

button.primary-btn:hover { opacity: 0.9; }
button.primary-btn:active { transform: scale(0.98); }

/* Results */
.results-box {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 32px;
    display: none;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 1rem;
}
.result-row:last-child { border-bottom: none; }
.result-val { font-weight: 800; color: var(--primary); font-size: 1.25rem; }

/* Affiliate Box */
.recommendation {
    margin-top: 24px;
    border: 2px solid var(--border);
    background-color: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rec-text h4 { margin: 0; font-size: 1rem; color: var(--primary); }
.rec-text p { margin: 4px 0 0 0; font-size: 0.9rem; color: var(--text-muted); }

.rec-btn {
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
    white-space: nowrap;
    margin-left: 15px;
}
.rec-btn:hover { opacity: 0.9; }

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    background: var(--surface);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
footer a { color: var(--text-muted); text-decoration: none; margin: 0 10px; }
footer a:hover { text-decoration: underline; }

/* --- THEME ENGINE --- */
body.theme-solar { --accent: #ca8a04; --accent-hover: #a16207; --bg: #fefce8; }
body.theme-concrete { --accent: #ea580c; --accent-hover: #c2410c; --bg: #fafaf9; }
body.theme-hvac { --accent: #0284c7; --accent-hover: #0369a1; --bg: #f0f9ff; }
body.theme-aquarium { --accent: #0891b2; --accent-hover: #0e7490; --bg: #ecfeff; }
body.theme-tile { --accent: #059669; --accent-hover: #047857; --bg: #f0fdf4; }
body.theme-pool { --accent: #0ea5e9; --accent-hover: #0284c7; --bg: #f0f9ff; } /* Sky Blue */
body.theme-lawn { --accent: #65a30d; --accent-hover: #4d7c0f; --bg: #f7fee7; } /* Lime Green */
body.theme-move { --accent: #d97706; --accent-hover: #b45309; --bg: #fffbeb; } /* Cardboard Amber */
body.theme-wall { --accent: #9333ea; --accent-hover: #7e22ce; --bg: #faf5ff; } /* Decorative Purple */
body.theme-wire { --accent: #dc2626; --accent-hover: #b91c1c; --bg: #fef2f2; } /* Safety Red */
body.theme-sourdough { --accent: #d97706; --accent-hover: #b45309; --bg: #fffbeb; } /* Amber */
body.theme-beverage { --accent: #db2777; --accent-hover: #be185d; --bg: #fdf2f8; } /* Pink */
body.theme-pet { --accent: #7c3aed; --accent-hover: #6d28d9; --bg: #f5f3ff; } /* Violet */