/**
 * AgeCalculatorz.com - Official Custom Stylesheet
 * Brand: White background, Navy typography, Royal blue buttons, Light blue cards.
 * Strict accessibility (WCAG AA/AAA), high contrast, print styles.
 */

:root {
    --bg-body: #ffffff;
    --bg-alt: #f8fafc;
    --bg-light-blue: #f0f7ff;
    --text-navy: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --sky-blue: #0284c7;
    --emerald: #059669;
    --amber: #d97706;
    --rose: #e11d48;
    --border-soft: #e2e8f0;
    --border-focus: #2563eb;
    --shadow-subtle: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-elevated: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-pill: 50rem;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-navy);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Accessibility: Skip to Content */
.skip-link {
    position: absolute;
    top: -50px;
    left: 10px;
    background: #000000;
    color: #ffffff;
    padding: 10px 20px;
    z-index: 9999;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top 0.2s ease-in-out;
}
.skip-link:focus {
    top: 10px;
    outline: 3px solid #facc15;
}

/* Accessible Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none !important;
    box-shadow: var(--focus-ring) !important;
}

/* Typography Helpers */
.text-navy {
    color: var(--text-navy) !important;
}
.bg-navy {
    background-color: var(--text-navy) !important;
}
.bg-light-blue {
    background-color: var(--bg-light-blue) !important;
}

/* Primary Button Styling */
.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #ffffff;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.15s ease-in-out;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-blue-hover);
    border-color: var(--primary-blue-hover);
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    border-width: 1.5px;
}
.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    color: #ffffff;
}

/* Cards */
.calculator-card {
    background-color: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.calculator-card:hover {
    box-shadow: var(--shadow-elevated);
}

.feature-card {
    background-color: var(--bg-light-blue);
    border: 1px solid #dbeafe;
    border-radius: var(--radius-lg);
}

/* Result Dashboard Box */
.result-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-elevated);
}
.result-hero .result-years {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 900;
    line-height: 1.1;
    color: #38bdf8;
}

/* Metric Stats Card */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    height: 100%;
}
.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-navy);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-muted);
}

/* Date Input Fieldset */
.date-input-group {
    background-color: var(--bg-alt) !important;
    border-color: var(--border-soft) !important;
    transition: border-color 0.2s ease;
}
.date-input-group:focus-within {
    border-color: var(--primary-blue) !important;
    background-color: #ffffff !important;
}
.form-select, .form-control {
    border-color: #cbd5e1;
    min-height: 44px; /* Accessible touch target */
}

/* Ticking Pulse */
.pulse-live {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
    animation: livePulse 1.5s infinite;
}
@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Footer Link Styling */
.footer-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s ease;
}
.footer-link:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Responsive Illustration & Diagram Styling */
.illustration-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem auto;
    width: 100%;
    max-width: 520px;
}

.illustration-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: var(--radius-md);
}

figure {
    margin: 1.5rem 0;
}

figure figcaption {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

/* Typography & Layout Helpers */
.fs-7 {
    font-size: 0.8125rem !important;
}
.text-xs {
    font-size: 0.75rem !important;
}
.hover-bg-light:hover {
    background-color: #f1f5f9 !important;
}
.transition {
    transition: all 0.15s ease-in-out;
}
.hover-shadow {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hover-shadow:hover {
    box-shadow: var(--shadow-subtle) !important;
    transform: translateY(-2px);
}
.sidebar-ad-wrapper {
    min-height: 90px;
}
.calculator-sidebar {
    position: relative;
}

/* Print Styles */
@media print {
    .navbar, footer, .calculator-form-container, .no-print, .skip-link, .btn {
        display: none !important;
    }
    .result-hero {
        background: #f8fafc !important;
        color: #000000 !important;
        border: 2px solid #000000 !important;
        box-shadow: none !important;
    }
    .result-hero .result-years {
        color: #000000 !important;
    }
    .stat-card {
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
}
