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

/* Variables */
:root {
    --primary: #1e3a8a;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg-gray: #f9fafb;
}

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: #fff;
}

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

/* Header */
header {
    background: var(--primary);
    padding: 16px 0;
    margin-bottom: 32px;
}

header nav a {
    color: #fff;
    text-decoration: none;
    margin-right: 24px;
    font-size: 0.9em;
}

header nav a:hover {
    text-decoration: underline;
}

/* Typography */
h1 {
    font-size: 2em;
    margin-bottom: 12px;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}

.subheading {
    text-align: center;
    margin-bottom: 32px;
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--primary);
    font-weight: 500;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

h2 {
    font-size: 1.5em;
    margin: 32px 0 16px;
    color: var(--primary);
    font-weight: 600;
}

h3 {
    font-size: 1.2em;
    margin: 24px 0 12px;
    font-weight: 600;
    color: var(--primary);
}

p {
    margin-bottom: 16px;
    line-height: 1.7;
}

/* Calculator Cards */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.calc-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
}

.calc-card h2 {
    margin-top: 0;
    font-size: 1.3em;
}

.calc-card ul {
    margin: 12px 0 12px 20px;
}

.calc-card li {
    margin-bottom: 6px;
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    font-size: 1em;
}

.btn:hover {
    background: #1e40af;
}

/* Form Elements */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1em;
}

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

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Results */
.results {
    background: var(--bg-gray);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.results h3 {
    margin-top: 0;
    color: var(--primary);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
}

.result-value {
    font-weight: 600;
    color: var(--primary);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
}

table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

table tbody tr:nth-child(even) {
    background: var(--bg-gray);
}

/* FAQ */
.faq {
    margin: 40px 0;
}

.faq-item {
    margin-bottom: 24px;
}

.faq-q {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* Disclaimer */
.disclaimer {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 16px;
    margin: 24px 0;
    font-size: 0.9em;
}

/* Page Disclaimer - YMYL Compliance */
.page-disclaimer {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 16px;
    margin: 24px 0;
    font-size: 0.9em;
    color: var(--text);
    line-height: 1.6;
}

.page-disclaimer strong {
    color: var(--text);
    font-weight: 600;
}

/* Content Wrapper for Legal Pages */
.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.content-wrapper h1 {
    text-align: left;
}

.content-wrapper p {
    text-align: left;
}

/* Content Section - Unified Width */
.content {
    margin: 0 auto;
}

.content p {
    margin-bottom: 20px;
}

/* Content Box - For Highlighted Sections */
.content-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
}

.content-box h2,
.content-box h3 {
    margin-top: 0;
}

/* Reduce gap between consecutive content boxes */
.content-box + .content-box {
    margin-top: 16px;
}

/* Ad Placeholders */
.ad-placeholder {
    background: var(--bg-gray);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.85em;
    margin: 32px 0;
}

#ad-top {
    min-height: 90px;
}

#ad-inline {
    min-height: 250px;
}

#ad-bottom {
    min-height: 90px;
}

#ad-sidebar {
    min-height: 600px;
}

/* Footer */
footer {
    background: var(--bg-gray);
    padding: 24px 0;
    margin-top: 48px;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    margin: 8px 0;
    font-size: 0.9em;
    color: var(--text-light);
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
    .input-row {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    .calc-card {
        padding: 20px;
    }
    
    #ad-inline {
        min-height: 200px;
    }
}

/* Sticky sidebar ad – desktop only */
@media (min-width: 1024px) {
  #ad-sidebar {
    min-height: 600px;
    position: -webkit-sticky; /* Safari support */
    position: sticky;
    top: 20px;
  }
}
