/* ========================================
   AFR Calculator - Shared Styles
   Clean, modern design system
   ======================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #f8f9fb;
    color: #1e293b;
    line-height: 1.65;
    min-height: 100vh;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   Navigation
   ======================================== */
.main-nav {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-brand a {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.nav-link.active {
    color: #1e40af;
    background: #eff6ff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: #334155;
    transition: all 0.3s;
    border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 860px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}

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

/* ========================================
   Header
   ======================================== */
.header {
    background: #0f172a;
    color: white;
    padding: 2.5rem 2rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.header p {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Page header variant for secondary pages */
.page-header {
    background: #0f172a;
    color: white;
    padding: 2rem 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}

.page-header p {
    font-size: 0.9rem;
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto;
}

/* ========================================
   Content
   ======================================== */
.content {
    padding: 2rem;
}

/* ========================================
   Update Notice
   ======================================== */
.update-notice {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.update-notice a {
    color: #166534;
    font-weight: 500;
}

/* ========================================
   Info Section
   ======================================== */
.info-section {
    margin-bottom: 2.5rem;
}

.info-section h2 {
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.info-section h3 {
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-size: 1.0625rem;
    font-weight: 600;
}

.info-section p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.info-section a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.info-section a:hover {
    text-decoration: underline;
}

/* ========================================
   Rate Cards
   ======================================== */
.rate-terms {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.rate-term {
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
    padding: 1.25rem 1rem;
    border-radius: 0.5rem;
    text-align: center;
    transition: border-color 0.15s;
    cursor: pointer;
}

.rate-term:hover {
    border-color: #94a3b8;
}

.rate-term strong {
    color: #0f172a;
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.rate-term small {
    color: #64748b;
    font-size: 0.8125rem;
    display: block;
    margin-bottom: 0.5rem;
}

.rate-display {
    color: #1e40af;
    font-weight: 700;
    font-size: 1.0625rem;
    margin-top: 0.375rem;
    padding: 0.375rem 0.5rem;
    background: #eff6ff;
    border-radius: 0.375rem;
    border: 1px solid #dbeafe;
}

.rate-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    text-align: left;
    animation: slideDown 0.2s ease;
}

.rate-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.rate-breakdown div {
    color: #475569;
}

.rate-details > p {
    color: #64748b;
    font-size: 0.8125rem;
    margin: 0;
}

.rate-calc-btn {
    background: #1e40af;
    color: white;
    border: none;
    padding: 0.4375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.75rem;
    width: 100%;
    text-align: center;
}

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

/* ========================================
   Compounding Info
   ======================================== */
.rate-explanation {
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 0.75rem;
}

.info-toggle {
    color: #2563eb;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
}

.info-toggle:hover {
    text-decoration: underline;
}

.compounding-info {
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.compounding-info ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.compounding-info li {
    margin-bottom: 0.25rem;
    color: #475569;
}

.compounding-info em {
    color: #64748b;
    font-size: 0.8125rem;
}

/* ========================================
   Calculator
   ======================================== */
.calculator-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 2rem;
}

.calculator-section h2 {
    color: #0f172a;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.form-intro {
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1.5rem;
}

.form-intro p {
    color: #475569;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.form-intro p + p {
    margin-top: 0.375rem;
}

.form-intro a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.form-intro a:hover {
    text-decoration: underline;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    transition: border-color 0.15s;
    background: white;
    color: #1e293b;
}

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

.form-group.error input,
.form-group.error select {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.error-message {
    color: #ef4444;
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

.form-help {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.dynamic-info {
    font-size: 0.8125rem;
    color: #059669;
    margin-top: 0.375rem;
    font-weight: 500;
    background: #f0fdf4;
    padding: 0.375rem 0.625rem;
    border-radius: 0.25rem;
    border-left: 2px solid #10b981;
    display: none;
}

.dynamic-info.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Select dropdown */
.form-group select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.625rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* Number input with steppers */
.number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.number-input-wrapper input[type="number"] {
    padding-right: 2.5rem;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.number-input-wrapper input[type="number"]::-webkit-outer-spin-button,
.number-input-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-steppers {
    position: absolute;
    right: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.stepper-btn {
    width: 1.75rem;
    height: 1.125rem;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: bold;
    transition: background 0.15s;
    user-select: none;
}

.stepper-btn:first-child {
    border-radius: 0.25rem 0.25rem 0 0;
}

.stepper-btn:last-child {
    border-radius: 0 0 0.25rem 0.25rem;
}

.stepper-btn:hover {
    background: #e5e7eb;
}

.stepper-btn:active {
    background: #d1d5db;
}

/* Currency input */
.currency-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-input-wrapper::before {
    content: '$';
    position: absolute;
    left: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    z-index: 1;
    pointer-events: none;
}

.currency-input {
    padding-left: 1.75rem !important;
}

/* Calculate button */
.calculate-btn {
    background: #1e40af;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
    margin-top: 0.75rem;
}

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

.calculate-btn:active {
    background: #1e3a8a;
}

/* ========================================
   Results
   ======================================== */
.results {
    margin-top: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    display: none;
}

.results.show {
    display: block;
    animation: slideIn 0.2s ease;
}

.results-header {
    background: #0f172a;
    color: white;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.results-body {
    padding: 1rem 1.25rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.result-item:last-child {
    border-bottom: none;
    background: #eff6ff;
    margin: 0.75rem -1.25rem -1rem;
    padding: 0.875rem 1.25rem;
    font-weight: 700;
    color: #1e40af;
}

.result-label {
    font-weight: 500;
    color: #64748b;
    font-size: 0.875rem;
}

.result-value {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9375rem;
}

.result-item:last-child .result-label,
.result-item:last-child .result-value {
    color: #1e40af;
    font-size: 1rem;
}

/* ========================================
   Charts Section
   ======================================== */
.charts-section {
    margin-top: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: none;
    background: #fafbfc;
}

.charts-section.show {
    display: block !important;
    animation: slideIn 0.2s ease;
}

.charts-header {
    margin-bottom: 1.5rem;
}

.charts-header h3 {
    color: #0f172a;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.charts-header p {
    color: #64748b;
    font-size: 0.875rem;
}

.bank-rate-info {
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.bank-rate-info p {
    color: #475569;
    margin: 0;
}

#customBankRate {
    width: 70px;
    padding: 0.25rem 0.375rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.recalculate-btn {
    background: #1e40af;
    color: white;
    border: none;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

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

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.chart-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1.25rem;
}

.chart-container h4 {
    color: #0f172a;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

.savings-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
}

.savings-item {
    text-align: center;
    padding: 0.5rem;
}

.savings-label {
    font-weight: 500;
    color: #64748b;
    font-size: 0.8125rem;
    display: block;
    margin-bottom: 0.25rem;
}

.savings-value {
    font-weight: 700;
    color: #059669;
    font-size: 1.125rem;
}

.chart-insights {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1.25rem;
    margin-top: 1.25rem;
    background: white;
}

.chart-insights h4 {
    color: #0f172a;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.insight-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-bullets li {
    color: #475569;
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.6;
    font-size: 0.875rem;
}

.insight-bullets li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    background: #2563eb;
    border-radius: 50%;
}

.insight-bullets li:last-child {
    margin-bottom: 0;
}

/* ========================================
   Payment Schedule
   ======================================== */
.schedule-section {
    margin-top: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: none;
    background: white;
}

.schedule-section.show {
    display: block !important;
    animation: slideIn 0.2s ease;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.schedule-header h3 {
    color: #0f172a;
    font-size: 1.125rem;
    font-weight: 700;
}

.schedule-controls {
    display: flex;
    gap: 0.5rem;
}

.export-btn,
.toggle-btn {
    background: #1e40af;
    color: white;
    border: none;
    padding: 0.4375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.export-btn:hover,
.toggle-btn:hover {
    background: #1d4ed8;
}

.toggle-btn {
    background: #475569;
}

.toggle-btn:hover {
    background: #334155;
}

.schedule-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
}

.summary-item {
    text-align: center;
}

.summary-label {
    font-weight: 500;
    color: #64748b;
    font-size: 0.8125rem;
    display: block;
    margin-bottom: 0.125rem;
}

.summary-value {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.0625rem;
}

/* Table */
.table-container {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.schedule-table th {
    background: #f8f9fb;
    color: #1e293b;
    font-weight: 600;
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8125rem;
}

.schedule-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
}

.schedule-table tbody tr:hover {
    background: #f8f9fb;
}

.schedule-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.table-collapsed {
    max-height: 300px;
    overflow-y: auto;
}

/* ========================================
   FAQ, Benefits, Summary Sections
   ======================================== */
.faq-section,
.benefits-section,
.summary-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
    margin-top: 2rem;
}

.faq-section h2,
.benefits-section h2,
.summary-section h2 {
    color: #0f172a;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

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

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    color: #0f172a;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.faq-item p {
    color: #475569;
    line-height: 1.7;
    font-size: 0.9375rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.benefit-item {
    padding: 1.25rem;
    background: #f8f9fb;
    border-radius: 0.5rem;
}

.benefit-item h3 {
    color: #0f172a;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.benefit-item p {
    color: #475569;
    line-height: 1.6;
    font-size: 0.875rem;
}

.summary-section p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.summary-section p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: #f8f9fb;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.site-footer p {
    color: #94a3b8;
    font-size: 0.8125rem;
    margin: 0;
}

.site-footer a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
}

.site-footer a:hover {
    color: #1e293b;
}

/* ========================================
   Mobile Jump Button
   ======================================== */
.mobile-jump-btn {
    display: none;
    background: #1e40af;
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 1.25rem;
    text-align: center;
    transition: background 0.15s;
}

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

/* ========================================
   Feedback Button
   ======================================== */
.feedback-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: #475569;
    color: white;
    padding: 0.4375rem 0.75rem;
    border-radius: 1.25rem;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1000;
    transition: background 0.15s;
    opacity: 0.8;
}

.feedback-btn:hover {
    background: #334155;
    opacity: 1;
    color: white;
    text-decoration: none;
}

/* ========================================
   Blog Cards
   ======================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.blog-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: border-color 0.15s;
}

.blog-card:hover {
    border-color: #94a3b8;
}

.blog-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.blog-card h3 a {
    color: inherit;
    text-decoration: none;
}

.blog-card h3 a:hover {
    color: #2563eb;
}

.blog-card p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.blog-card .category-badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.blog-card .read-more {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
}

.blog-card .read-more:hover {
    text-decoration: underline;
}

/* Filter buttons */
.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    background: white;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover {
    border-color: #94a3b8;
    color: #1e293b;
}

.filter-btn.active {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

/* ========================================
   Historical Rates
   ======================================== */
.rate-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.rate-card .rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
}

.rate-card .rate-header:hover {
    background: #f8f9fb;
}

.rate-card .rate-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
}

.rate-card .toggle-icon {
    color: #94a3b8;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.rate-card .rate-content {
    display: none;
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.rate-card.expanded .rate-content {
    display: block;
}

.rate-card.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Term badges */
.term-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.term-badge.short-term {
    background: #ecfdf5;
    color: #059669;
}

.term-badge.mid-term {
    background: #fffbeb;
    color: #d97706;
}

.term-badge.long-term {
    background: #fef2f2;
    color: #dc2626;
}

/* Rate grid for historical */
.rate-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rate-item {
    text-align: center;
    padding: 0.5rem;
    background: #f8f9fb;
    border-radius: 0.25rem;
}

.rate-item .rate-label {
    font-size: 0.6875rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.125rem;
}

.rate-item .rate-value,
.rate-item a.rate-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}

.rate-item a.rate-value.clickable-rate {
    color: #2563eb;
    text-decoration: none;
}

.rate-item a.rate-value.clickable-rate:hover {
    text-decoration: underline;
}

/* Historical rate sections */
.rate-section {
    margin-bottom: 1rem;
}

.rate-section:last-child {
    margin-bottom: 0;
}

.rate-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

/* ========================================
   Guide Page
   ======================================== */
.guide-content {
    padding: 2rem;
}

.guide-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2rem 0 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.guide-content h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.guide-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1.5rem 0 0.5rem;
}

.guide-content p {
    color: #475569;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.guide-content ul,
.guide-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.guide-content li {
    color: #475569;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.guide-content a {
    color: #2563eb;
    text-decoration: none;
}

.guide-content a:hover {
    text-decoration: underline;
}

/* ========================================
   Search & Controls (Historical page)
   ======================================== */
.search-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* Compounding selector */
.compounding-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.compounding-selector label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

.compounding-selector select {
    padding: 0.375rem 2rem 0.375rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* ========================================
   Chart Legend (Historical page)
   ======================================== */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #64748b;
}

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

/* ========================================
   Navigation (sub-pages)
   ======================================== */
.navigation {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navigation a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.navigation a:hover {
    text-decoration: underline;
}

/* ========================================
   Animations
   ======================================== */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

    .rate-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.25rem;
        border-bottom: 1px solid #e2e8f0;
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.2s ease;
        pointer-events: none;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-link {
        display: block;
        padding: 0.625rem 0.75rem;
    }

    .container {
        border-left: none;
        border-right: none;
    }

    .header,
    .page-header {
        padding: 1.75rem 1.25rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.375rem;
    }

    .content,
    .guide-content {
        padding: 1.5rem 1.25rem;
    }

    .rate-terms {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .calculator-section {
        padding: 1.25rem;
    }

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

    .savings-summary,
    .schedule-summary {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .savings-item,
    .summary-item {
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

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

    .mobile-jump-btn {
        display: block;
    }

    .schedule-section,
    .charts-section {
        padding: 1rem;
    }

    .rate-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .filter-group {
        gap: 0.25rem;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.3125rem 0.625rem;
    }

    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .navigation {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .container-wide {
        padding: 1.5rem 1.25rem;
    }

    .feedback-btn {
        bottom: 10px;
        right: 10px;
    }
}
