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

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Typography ===== */
h1, h2, h3 {
    line-height: 1.25;
    color: #0f172a;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 1.875rem);
    font-weight: 600;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #1d4ed8;
}

/* ===== Header ===== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #0f172a;
    text-decoration: none;
}

.logo svg {
    color: #2563eb;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    font-weight: 500;
    font-size: 0.9375rem;
    color: #475569;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

nav a:hover,
nav a[aria-current="page"] {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #ede9fe 100%);
    padding: 3rem 1.5rem;
    text-align: center;
}

.subtitle {
    font-size: 1.125rem;
    color: #475569;
    max-width: 600px;
    margin: 0.75rem auto 0;
}

/* ===== Section Common ===== */
.section-title {
    margin-bottom: 1.5rem;
    text-align: center;
}

.calculator-section,
.info-section,
.faq-section {
    padding: 3rem 1.5rem;
}

.info-section {
    background: #ffffff;
}

.faq-section {
    background: #f1f5f9;
}

/* ===== Calculator Layout ===== */
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
}

.calc-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #0f172a;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.btn-primary {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* ===== Results Panel ===== */
.results-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.result-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.result-value {
    display: block;
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
}

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

.status-text {
    color: #2563eb;
}

.status-text.on-track {
    color: #059669;
}

.status-text.off-track {
    color: #dc2626;
}

.chart-container {
    margin: 1.5rem 0;
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 200px;
}

.chart-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

.result-details {
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.6;
}

/* ===== Tips Grid ===== */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.tip-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.tip-card h3 {
    margin-bottom: 0.5rem;
    color: #1e40af;
}

.tip-card p {
    font-size: 0.9375rem;
    color: #475569;
}

/* ===== FAQ ===== */
.faq-list {
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #d1d5db;
    padding: 1.25rem 0;
}

.faq-item:first-child {
    border-top: 1px solid #d1d5db;
}

.faq-item dt {
    font-weight: 600;
    font-size: 1.0625rem;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.faq-item dd {
    font-size: 0.9375rem;
    color: #475569;
}

/* ===== Footer ===== */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 2rem 1.5rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-copy {
    font-size: 0.8125rem;
    color: #64748b;
}

/* ===== About Page ===== */
.about-section {
    padding: 3rem 1.5rem;
    background: #ffffff;
}

.about-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1rem;
    color: #334155;
    line-height: 1.7;
}

/* ===== Legal Pages ===== */
.legal-section {
    padding: 3rem 1.5rem;
    background: #ffffff;
    min-height: 60vh;
}

.legal-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 0.9375rem;
    color: #334155;
    line-height: 1.7;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .results-summary {
        grid-template-columns: 1fr;
    }

    .status-card {
        grid-column: span 1;
    }

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

    .site-header .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav ul {
        gap: 1rem;
    }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
