@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --midnight: #0a192f;
    --midnight-light: #112240;
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --gold-bg: #fcf8eb;
    --white: #ffffff;
    --off-white: #f8fafc;
    --slate: #475569;
    --border: rgba(10, 25, 47, 0.1);
    --radius-lg: 1.5rem;
    --radius-md: 0.8rem;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--midnight);
    background-color: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Libre Baskerville', serif;
    color: var(--midnight);
    line-height: 1.3;
}

/* Header */
header {
    background: var(--white);
    padding: 1.5rem 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--midnight);
}

.logo span { color: var(--gold); }

nav ul { display: flex; list-style: none; gap: 2rem; }
nav a {
    text-decoration: none;
    color: var(--midnight);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}
nav a:hover { color: var(--gold); }

/* Hero Section */
.hero {
    background: radial-gradient(circle at 10% 20%, #f1f5f9 0%, #fff 100%);
    padding: 8rem 5% 5rem;
    text-align: center;
}

.hero-wrap { max-width: 900px; margin: 0 auto; }

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.4rem;
    color: var(--slate);
    margin-bottom: 3rem;
}

/* Premium Tool Container */
.tool-container {
    padding: 0 5% 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    .sub-results { 
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem;
    }
}

.calculator-card {
    background: var(--white);
    width: 100%;
    max-width: 1100px;
    padding: 4rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 50px 100px -20px rgba(10, 25, 47, 0.15);
    border: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.calculator-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, var(--gold) 0%, transparent 100%);
    z-index: -1;
    border-radius: inherit;
    opacity: 0.1;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.6rem; }

label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate);
}

input, select {
    padding: 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    transition: var(--transition);
    background: #fdfdfd;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 5px var(--gold-glow);
}

.span-2 { grid-column: span 2; }

/* Advanced Settings */
.advanced-panel {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border);
}

.hidden { display: none !important; }

#toggle-advanced {
    background: none;
    border: none;
    color: var(--gold);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.calculate-btn {
    width: 100%;
    padding: 1.5rem;
    background: var(--midnight);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 2rem;
}

.calculate-btn:hover {
    background: var(--midnight-light);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(10, 25, 47, 0.2);
}

/* Results Dashboard */
.results-header {
    margin-top: 5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.hidden-tool { display: none !important; }

.main-result {
    grid-column: span 2;
    background: var(--midnight);
    color: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-wrap { text-align: left; }
.metric-label { font-size: 0.9rem; text-transform: uppercase; opacity: 0.8; letter-spacing: 0.1em; }
.metric-value { font-family: 'Libre Baskerville', serif; font-size: 3.5rem; color: var(--gold); display: block; margin-top: 0.5rem; }

.sub-results {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.sub-card {
    background: var(--off-white);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border);
}

.sub-card .v { font-size: 1.8rem; font-weight: 700; color: var(--midnight); display: block; }
.sub-card .l { font-size: 0.75rem; color: var(--slate); text-transform: uppercase; margin-top: 0.5rem; display: block; }

.cost-breakdown {
    grid-column: span 2;
    background: var(--gold-bg);
    padding: 2rem 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gold);
    display: flex;
    justify-content: space-around;
}

.cost-item { text-align: center; }
.cost-item .val { font-size: 1.5rem; font-weight: 800; display: block; }

.print-bar { margin-top: 3rem; text-align: center; }
.btn-secondary {
    padding: 1rem 2.5rem;
    background: var(--gold);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

/* Content Layout */
.section { padding: 8rem 8%; }
.bg-soft { background: var(--off-white); }

.content-max { max-width: 1100px; margin: 0 auto; }

.grid-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; margin-top: 3rem; }

.pro-box {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(10, 25, 47, 0.05);
    border-left: 6px solid var(--gold);
}

.pro-box ul { list-style: none; margin-top: 1.5rem; }
.pro-box li { margin-bottom: 1rem; padding-left: 1.5rem; position: relative; }
.pro-box li::before { content: '•'; color: var(--gold); position: absolute; left: 0; font-weight: 900; }

/* Table Styling */
.table-wrap { margin-top: 3rem; border-radius: 1rem; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { background: var(--midnight); color: var(--gold); padding: 1.5rem; text-align: left; font-size: 0.85rem; text-transform: uppercase; }
td { padding: 1.5rem; border-bottom: 1px solid var(--border); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; }
.faq-item { background: var(--white); padding: 2rem; border-radius: 1rem; border: 1px solid var(--border); }
.faq-item h4 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--midnight); }

/* Print Styles */
@media print {
    header, nav, .hero, .calculate-btn, #toggle-advanced, .section, footer, .print-bar { display: none !important; }
    .tool-container { padding: 0; }
    .calculator-card { box-shadow: none; border: 1px solid #000; padding: 2rem; width: 100%; }
    .results-header { display: block !important; }
    .main-result { background: none !important; color: #000 !important; border: 2px solid #000; margin-bottom: 2rem; }
    .metric-value { color: #000 !important; }
    body { background: #fff; }
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .grid-cols, .faq-grid { grid-template-columns: 1fr; }
    .sub-results { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.8rem; }
}

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .sub-results { grid-template-columns: 1fr; }
    .cost-breakdown { flex-direction: column; gap: 1.5rem; }
    .main-result { flex-direction: column; text-align: center; gap: 2rem; }
    .metric-value { font-size: 2.5rem; }
}
