/* ===========================
   Hong Kong Mortgage Calculator
   Modern CSS Styles
   =========================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #0891b2;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;

    /* Chart Colors */
    --chart-principal: #2563eb;
    --chart-interest: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Spacing */
    --container-max: 1200px;
    --section-padding: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

p {
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--primary-dark);
}

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

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h2 {
    color: white;
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* ===========================
   Calculator Section
   =========================== */
.calculator-section {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Calculator Form */
.calculator-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.calculator-form h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    color: var(--gray-400);
    cursor: help;
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--gray-800);
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    border-radius: var(--radius);
    z-index: 10;
    margin-top: 4px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper .currency,
.input-wrapper .percent,
.input-wrapper .unit {
    padding: 0 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.input-wrapper input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    min-width: 0;
}

.input-wrapper input:focus {
    outline: none;
}

.input-row {
    display: flex;
    gap: 0.75rem;
}

.input-row .input-wrapper:first-child {
    flex: 2;
}

.percentage-input {
    flex: 1;
    max-width: 100px;
}

/* Range Slider */
input[type="range"] {
    width: 100%;
    height: 6px;
    margin-top: 0.75rem;
    background: var(--gray-200);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Calculated Field */
.form-group.calculated {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(8, 145, 178, 0.05));
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px dashed var(--primary);
}

.calculated-value {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.ltv-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    font-size: 0.8125rem;
    border-radius: var(--radius-xl);
}

/* Rate Type Toggle */
.rate-type-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rate-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rate-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.rate-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.rate-info {
    margin-top: 0.5rem;
}

.rate-info small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Term Presets */
.term-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preset-btn {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.preset-btn.active {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: white;
}

/* Calculate Button */
.calculate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.5);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* ===========================
   Results Panel
   =========================== */
.results-panel {
    position: sticky;
    top: 80px;
}

.result-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.result-card.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.result-card h4 {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.result-card.primary h4 {
    color: rgba(255, 255, 255, 0.9);
}

.result-value {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.result-value.small {
    font-size: 1.5rem;
}

.result-value .currency {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

.result-note {
    font-size: 0.8125rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Donut Chart */
.chart-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.chart-card h4 {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.donut-chart {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1rem;
}

.donut-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-ring {
    fill: none;
    stroke: var(--gray-100);
    stroke-width: 12;
}

.donut-segment {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dasharray var(--transition-slow);
}

.donut-segment.principal {
    stroke: var(--chart-principal);
}

.donut-segment.interest {
    stroke: var(--chart-interest);
}

.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.chart-center span {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.chart-center small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.principal {
    background: var(--chart-principal);
}

.legend-color.interest {
    background: var(--chart-interest);
}

.legend-item strong {
    margin-left: auto;
    color: var(--text-primary);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-item {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===========================
   Stress Test Section
   =========================== */
.stress-test-section {
    padding: var(--section-padding) 0;
    background: var(--bg-primary);
}

.section-icon {
    margin-right: 0.5rem;
}

.section-desc {
    max-width: 700px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.stress-test-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stress-test-card {
    flex: 1;
    max-width: 300px;
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.stress-test-card.stress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
    border: 2px solid var(--warning);
}

.stress-header {
    margin-bottom: 1rem;
}

.stress-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stress-rate {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stress-test-card.stress .stress-rate {
    color: var(--warning);
}

.result-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.result-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.stress-test-card.stress .result-amount {
    color: var(--danger);
}

.stress-arrow {
    font-size: 2rem;
    color: var(--gray-400);
}

/* Income Requirement */
.income-requirement {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.income-requirement h4 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.income-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.income-card {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.income-card.highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.income-label {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.income-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.income-card.highlight .income-value {
    color: white;
}

/* ===========================
   Schedule Section
   =========================== */
.schedule-section {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
}

.schedule-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 0.25rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.export-btn:hover {
    background: var(--primary);
    color: white;
}

/* Schedule Table */
.schedule-table-wrapper {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    padding: 1rem;
    text-align: right;
}

.schedule-table th:first-child,
.schedule-table td:first-child {
    text-align: left;
}

.schedule-table thead {
    background: var(--bg-tertiary);
}

.schedule-table th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.schedule-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.schedule-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.schedule-table td {
    font-size: 0.9375rem;
}

/* Schedule Bar Chart */
.schedule-chart {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.schedule-chart h4 {
    margin-bottom: 1rem;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 120px;
    padding: 0 0.5rem;
}

.bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    min-height: 2px;
    transition: height var(--transition-slow);
}

.bar.principal {
    background: var(--chart-principal);
    border-radius: 2px 2px 0 0;
}

.bar.interest {
    background: var(--chart-interest);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===========================
   Guide Section
   =========================== */
.guide-section {
    padding: var(--section-padding) 0;
    background: var(--bg-primary);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.guide-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: transform var(--transition), box-shadow var(--transition);
}

.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.guide-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.guide-card h4 {
    margin-bottom: 0.75rem;
}

.guide-card p {
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
}

.guide-card ul {
    list-style: none;
    font-size: 0.875rem;
}

.guide-card li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.guide-card li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* FAQ Section */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
}

.faq-section h4 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition-fast);
}

.faq-item summary:hover {
    background: var(--gray-200);
}

.faq-item summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--primary);
    transition: transform var(--transition-fast);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 1.25rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ===========================
   SEO Section
   =========================== */
.seo-section {
    padding: var(--section-padding) 0;
    background: var(--bg-tertiary);
}

.seo-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.seo-content {
    max-width: 900px;
    margin: 0 auto;
    column-count: 1;
}

.seo-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.seo-content p {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.8;
    text-align: justify;
}

.seo-content strong {
    color: var(--primary);
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 3rem 0 1.5rem;
}

.footer .container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.footer-desc {
    font-size: 0.875rem;
    max-width: 300px;
}

.footer-links {
    display: flex;
    gap: 3rem;
}

.footer-col h5 {
    color: white;
    margin-bottom: 0.75rem;
}

.footer-col a {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    grid-column: 1 / -1;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-700);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .results-panel {
        position: static;
    }

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

@media (max-width: 768px) {
    :root {
        --section-padding: 3rem;
    }

    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .hero-features {
        flex-direction: column;
        align-items: center;
    }

    .stress-test-wrapper {
        flex-direction: column;
    }

    .stress-arrow {
        transform: rotate(90deg);
    }

    .stress-test-card {
        max-width: 100%;
        width: 100%;
    }

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

    .schedule-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .schedule-table {
        font-size: 0.875rem;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 0.75rem 0.5rem;
    }

    .footer .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-desc {
        max-width: 100%;
    }

    .seo-content {
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .input-row {
        flex-direction: column;
    }

    .percentage-input {
        max-width: 100%;
    }

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

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .rate-type-toggle {
        flex-direction: column;
    }

    .term-presets {
        flex-wrap: wrap;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-form,
.results-panel,
.stress-test-card,
.guide-card {
    animation: fadeIn 0.5s ease-out;
}

/* Print Styles */
@media print {
    .header,
    .hero,
    .calculate-btn,
    .schedule-controls,
    .footer {
        display: none;
    }

    .calculator-wrapper {
        display: block;
    }

    .results-panel {
        break-inside: avoid;
    }
}
