:root {
    --bg-color: #0B1F3A; /* Main background - Deep Navy */
    --card-bg: rgba(15, 31, 58, 0.85); /* Card background - Dark Navy Glass */
    --card-border: rgba(191, 219, 254, 0.2); /* Subtle blue separation - #BFDBFE */
    --border-accent: #BFDBFE; /* Border highlight */
    --primary: #2563EB; /* Primary Blue - Royal Blue */
    --primary-gradient: linear-gradient(135deg, #2563EB, #1D4ED8);
    --primary-hover: #1D4ED8;
    --secondary: #10B981; /* Profit / Savings - Emerald Green */
    --secondary-gradient: linear-gradient(135deg, #10B981, #059669);
    --current-offer: #1D4ED8; /* Current Offer - Bright Blue */
    --sky-blue: #DBEAFE; /* Light Blue - Sky Blue */
    --rate-old: #94A3B8; /* Old Interest Rate - Slate Gray */
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-main: #FFFFFF; /* Main text - White */
    --text-muted: #CBD5E1; /* Secondary text - Blue-Gray */
    --input-bg: rgba(11, 31, 58, 0.7);
    --glass-shadow: 0 20px 48px 0 rgba(0, 0, 0, 0.5);
    --accent-glow: rgba(37, 99, 235, 0.35);
    --emerald-glow: rgba(16, 185, 129, 0.35);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Background Animations */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    animation: float 12s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, rgba(11, 31, 58, 0) 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16) 0%, rgba(11, 31, 58, 0) 70%);
    animation-delay: -6s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6%, 8%) scale(1.08); }
}

/* Container */
.calculator-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.25rem;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calculator-container:hover {
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
}

header {
    text-align: center;
    margin-bottom: 1.75rem;
}

header h1 {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

/* Form Styles */
.input-group {
    margin-bottom: 1.25rem;
}

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

.input-group.row .half {
    flex: 1;
}

.label-with-toggle, .label-with-hint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.label-with-toggle label, .label-with-hint label {
    margin-bottom: 0;
}

.cutoff-hint {
    font-size: 0.75rem;
    color: var(--sky-blue);
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(191, 219, 254, 0.3);
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    font-weight: 500;
}

.unit-switch {
    display: flex;
    background: rgba(11, 31, 58, 0.85);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.unit-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-group:focus-within label {
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.currency, .percent, .unit {
    padding: 0.8rem 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(11, 31, 58, 0.85);
    white-space: nowrap;
}

input[type="number"], input[type="date"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
}

input[type="date"] {
    color-scheme: dark;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-main);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
    padding-right: 0.5rem;
}

input[type="number"]::placeholder {
    color: var(--rate-old);
}

input[type="number"]:focus, input[type="date"]:focus {
    outline: none;
}

/* Hide number arrows */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Date Rule Badge */
.date-rule-explanation {
    margin-top: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    background: rgba(11, 31, 58, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.date-rule-explanation.before-21 {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}

.date-rule-explanation.before-21 strong {
    color: var(--secondary);
}

.date-rule-explanation.after-21 {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

.date-rule-explanation.after-21 strong {
    color: var(--warning);
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    margin-top: 0.75rem;
}

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

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

.calculate-btn svg {
    transition: transform 0.3s ease;
}

.calculate-btn:hover svg {
    transform: translateX(4px);
}

/* Results Section */
.results {
    margin-top: 2rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
    animation: slideUp 0.4s ease forwards;
}

.results.hidden {
    display: none;
}

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

.result-card {
    background: rgba(15, 31, 58, 0.7);
    border-radius: 18px;
    padding: 1.4rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

/* 1. Outstanding Amount & Timeline Card */
.result-card.outstanding-card {
    background: rgba(15, 31, 58, 0.75);
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(191, 219, 254, 0.25);
}

.card-tag.tag-cyan {
    color: var(--sky-blue);
    background: rgba(37, 99, 235, 0.2);
}

.as-of-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(11, 31, 58, 0.8);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.timeline-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin: 1rem 0;
    background: rgba(11, 31, 58, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    text-align: center;
}

.timeline-step .step-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.timeline-step .step-value {
    font-size: 0.88rem;
    color: var(--text-main);
    font-weight: 600;
}

.timeline-step.highlight .step-value {
    color: var(--sky-blue);
}

.timeline-arrow {
    color: rgba(191, 219, 254, 0.35);
    font-size: 0.9rem;
    user-select: none;
}

/* Progress Bar */
.progress-bar-container {
    margin-bottom: 1.1rem;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(11, 31, 58, 0.8);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #1D4ED8, #10B981);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Outstanding Hero */
.outstanding-hero {
    text-align: center;
    padding: 0.9rem 0;
    border-top: 1px dashed var(--card-border);
    border-bottom: 1px dashed var(--card-border);
    margin-bottom: 1rem;
}

.outstanding-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.outstanding-value {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--text-main);
    text-shadow: 0 0 24px rgba(37, 99, 235, 0.3);
    margin: 0.2rem 0;
    letter-spacing: -0.5px;
}

.outstanding-subtitle {
    font-size: 0.78rem;
    color: var(--rate-old);
    opacity: 0.85;
}

/* Sub-stats Grid */
.sub-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.stat-box {
    background: rgba(11, 31, 58, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

/* 2. Secondary Offer Card */
.result-card.secondary {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.15), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(29, 78, 216, 0.45);
}

.result-card.secondary .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.result-card.secondary h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    background: rgba(29, 78, 216, 0.25);
    color: var(--sky-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--current-offer);
}

.offer-tenure-pill {
    font-size: 0.78rem;
    color: var(--sky-blue);
    background: rgba(37, 99, 235, 0.2);
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(191, 219, 254, 0.3);
    font-weight: 500;
}

.offer-base-notice {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    margin-bottom: 1rem;
}

.offer-base-notice strong {
    color: #34d399;
}

/* Result Live Adjusters (Rate + Tenure) */
.result-live-adjusters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(11, 31, 58, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 0.85rem;
    margin-bottom: 1.1rem;
}

.live-rate-adjuster {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.live-rate-adjuster label {
    margin-bottom: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-wrapper.mini {
    max-width: 130px;
    height: 36px;
    background: rgba(11, 31, 58, 0.85);
    border-radius: 8px;
}

.input-wrapper.mini input {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    text-align: right;
    font-weight: 600;
    color: var(--sky-blue);
}

.input-wrapper.mini .percent {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.result-tenure-adjuster {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.adjuster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.adjuster-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.custom-months-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(11, 31, 58, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    margin: 0.35rem 0 0.5rem 0;
}

.custom-months-input-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.custom-months-input-group label {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tenure-input-wrapper {
    max-width: 130px;
    height: 40px;
    background: rgba(11, 31, 58, 0.85);
    border-radius: 8px;
}

.tenure-input-wrapper input {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sky-blue);
    text-align: right;
    padding: 0.35rem 0.6rem;
}

.tenure-conversion-badge {
    font-size: 0.82rem;
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.comparison-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.detail-row strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Savings Grid */
.savings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin: 0.8rem 0;
}

.saving-card {
    background: rgba(11, 31, 58, 0.7);
    border-radius: 14px;
    padding: 0.9rem;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    transition: transform 0.2s ease;
}

.saving-card:hover {
    transform: translateY(-2px);
}

.saving-card.yearly-saving {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(37, 99, 235, 0.12));
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}

.saving-title {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.saving-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #34d399;
}

.saving-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--secondary);
    opacity: 0.9;
}

.detail-row.highlight {
    padding-top: 0.9rem;
    border-top: 1px dashed var(--card-border);
}

.detail-row.highlight strong {
    color: #34d399;
    font-size: 1.15rem;
    font-weight: 700;
}

/* Breakdown Section */
.breakdown-toggle-wrapper {
    margin-top: 1rem;
    text-align: center;
}

.breakdown-btn {
    width: 100%;
    background: rgba(11, 31, 58, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.breakdown-btn:hover {
    background: rgba(11, 31, 58, 0.9);
    color: var(--text-main);
    border-color: var(--card-border);
}

.chevron-icon {
    transition: transform 0.3s ease;
}

.breakdown-btn.expanded .chevron-icon {
    transform: rotate(180deg);
}

.breakdown-content {
    margin-top: 1rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    animation: fadeIn 0.3s ease;
}

.breakdown-content.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-responsive {
    overflow-x: auto;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: rgba(11, 31, 58, 0.7);
    text-align: right;
}

.breakdown-table th, .breakdown-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--card-border);
}

.breakdown-table th {
    background: rgba(15, 31, 58, 0.9);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.breakdown-table th:first-child, .breakdown-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
}

.breakdown-table tfoot tr,
.breakdown-table tr.total-row {
    background: rgba(15, 31, 58, 0.95);
    border-top: 2px solid var(--card-border);
}

.breakdown-table tfoot td,
.breakdown-table tr.total-row td {
    padding: 0.85rem 0.8rem;
    font-size: 0.88rem;
    color: var(--text-main);
}

.breakdown-table tfoot td:first-child,
.breakdown-table tr.total-row td:first-child {
    color: var(--sky-blue);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.diff-positive {
    color: #059669;
    font-weight: 600;
}

.diff-negative {
    color: var(--danger);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 540px) {
    .calculator-container {
        padding: 1.5rem 1.1rem;
        border-radius: 20px;
    }
    
    .input-group.row {
        flex-direction: column;
        gap: 1.25rem;
    }
    
    .outstanding-value {
        font-size: 1.9rem;
    }

    .sub-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .timeline-grid {
        flex-direction: column;
        gap: 0.5rem;
    }

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

    /* Mobile Enhancements for Tenure and Offer Adjusters */
    .result-live-adjusters {
        padding: 1rem;
        gap: 0.9rem;
    }

    .live-rate-adjuster {
        padding: 0.2rem 0;
    }

    .live-rate-adjuster .input-wrapper.mini {
        max-width: 140px;
        height: 44px;
    }

    .live-rate-adjuster .input-wrapper.mini input {
        font-size: 1.1rem;
    }

    .custom-months-box {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.85rem;
    }

    .custom-months-input-group {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .custom-months-input-group label {
        font-size: 0.92rem;
    }

    .tenure-input-wrapper {
        max-width: 140px;
        height: 44px;
    }

    .tenure-input-wrapper input {
        font-size: 1.15rem;
    }

    .tenure-conversion-badge {
        text-align: center;
        font-size: 0.88rem;
        padding: 0.45rem 0.75rem;
        width: 100%;
    }

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

    .modal-backdrop {
        padding: 0.75rem 0.5rem;
    }

    .modal-dialog {
        padding: 1.25rem 1rem;
        border-radius: 18px;
        max-height: 94vh;
    }

    .whatsapp-share-cta-card {
        padding: 1.25rem;
    }

    .whatsapp-action-buttons,
    .modal-actions-bar {
        flex-direction: column;
    }

    .whatsapp-primary-btn, 
    .whatsapp-secondary-btn,
    .btn-subaction, 
    .btn-primary-action, 
    .btn-whatsapp-direct {
        width: 100%;
        flex: 1 1 100%;
    }

    .slide-nav-tabs {
        gap: 0.35rem;
        padding: 0.3rem;
    }

    .slide-tab-btn {
        padding: 0.5rem 0.35rem;
        font-size: 0.76rem;
        gap: 0.35rem;
    }

    .slide-tab-btn .slide-num {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    .preview-card-viewport {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
}

@media (max-width: 400px) {
    .calculator-container {
        padding: 1.25rem 0.8rem;
    }
    
    header h1 {
        font-size: 1.7rem;
    }
    
    .modal-dialog {
        padding: 1rem 0.75rem;
        border-radius: 16px;
    }

    .slide-tab-btn {
        flex-direction: column;
        padding: 0.45rem 0.2rem;
        font-size: 0.72rem;
        gap: 0.25rem;
        text-align: center;
    }
    
    .preview-card-viewport {
        max-width: 280px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 1rem 0.5rem;
    }

    .calculator-container {
        padding: 1.1rem 0.65rem;
        border-radius: 16px;
    }

    header h1 {
        font-size: 1.55rem;
    }

    header p {
        font-size: 0.84rem;
    }

    .outstanding-value {
        font-size: 1.65rem;
    }

    .cutoff-hint {
        font-size: 0.72rem;
        padding: 0.12rem 0.45rem;
    }

    .preview-stage-container {
        padding: 0.85rem 0.5rem;
    }

    .preview-card-viewport {
        max-width: 240px;
    }

    .sub-stats-grid .stat-box {
        padding: 0.5rem 0.35rem;
    }

    .stat-value {
        font-size: 0.82rem;
    }
}

/* ==========================================================================
   WhatsApp 3-Image Loan Refinancing Share Flow Styles
   ========================================================================== */

/* 1. On-Page CTA Card */
.whatsapp-share-cta-card {
    margin-top: 2rem;
    padding: 1.75rem;
    background: linear-gradient(145deg, rgba(15, 31, 58, 0.95), rgba(11, 25, 48, 0.98));
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 20px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(37, 211, 102, 0.12);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.whatsapp-share-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.whatsapp-cta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.whatsapp-cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    background: rgba(37, 211, 102, 0.15);
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 20px;
    color: #25D366;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.whatsapp-cta-badge .whatsapp-icon {
    fill: #25D366;
}

.dimensions-tag {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sky-blue);
    background: rgba(219, 234, 254, 0.1);
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(219, 234, 254, 0.2);
}

.whatsapp-cta-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.4rem;
}

.whatsapp-cta-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.whatsapp-action-buttons {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.whatsapp-primary-btn {
    flex: 1 1 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.4rem;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.whatsapp-primary-btn:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(37, 99, 235, 0.55);
}

.whatsapp-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.4);
    color: #34D399;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.whatsapp-secondary-btn:hover {
    background: rgba(37, 211, 102, 0.22);
    border-color: #25D366;
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* 2. Modal Overlay & Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 15, 30, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    overflow: hidden;
}

.modal-backdrop.hidden {
    display: none !important;
}

.modal-dialog {
    background: #0D1F38;
    border: 1px solid rgba(191, 219, 254, 0.25);
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(37, 99, 235, 0.2);
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog::-webkit-scrollbar {
    width: 6px;
}

.modal-dialog::-webkit-scrollbar-track {
    background: rgba(11, 25, 48, 0.5);
    border-radius: 4px;
}

.modal-dialog::-webkit-scrollbar-thumb {
    background: rgba(191, 219, 254, 0.25);
    border-radius: 4px;
}

.modal-dialog::-webkit-scrollbar-thumb:hover {
    background: rgba(191, 219, 254, 0.45);
}

@keyframes modalPopIn {
    0% { opacity: 0; transform: scale(0.94) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: relative;
}

.modal-title-wrap h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-top: 0.35rem;
    margin-bottom: 0.25rem;
}

.modal-title-wrap p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #34D399;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.modal-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #EF4444;
}

/* 3. Slide Switcher Tabs */
.slide-nav-tabs {
    display: flex;
    gap: 0.6rem;
    background: rgba(11, 25, 48, 0.7);
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid rgba(191, 219, 254, 0.15);
    margin-bottom: 1.5rem;
}

.slide-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slide-tab-btn .slide-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.slide-tab-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.slide-tab-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.slide-tab-btn.active .slide-num {
    background: #FFFFFF;
    color: var(--primary);
}

/* 4. Preview Viewport */
.preview-stage-container {
    background: #08162A;
    border: 1px solid rgba(191, 219, 254, 0.18);
    border-radius: 18px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-card-viewport {
    width: 320px;
    max-width: 100%;
    height: 400px;
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(37, 99, 235, 0.15);
    overflow: hidden;
    position: relative;
    background: #0B1F3A;
    border: 1px solid rgba(191, 219, 254, 0.25);
    margin: 0 auto;
}

/* Scaled Preview Frame containing the 1080x1350 card scaled down */
.preview-card-viewport .share-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 1080px !important;
    height: max-content !important;
    transform: scale(0.2963); /* 320 / 1080 = ~0.2963 */
    transform-origin: top left;
    pointer-events: none;
    user-select: none;
}

.preview-nav-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-arrow-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-arrow-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.slide-indicator-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--sky-blue);
    font-family: monospace;
}

/* 5. Modal Actions Bar */
.modal-actions-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn-subaction {
    flex: 1 1 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(191, 219, 254, 0.25);
    color: #FFFFFF;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-subaction:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-accent);
}

.btn-primary-action {
    flex: 1.5 1 260px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.4rem;
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
}

.btn-primary-action:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.btn-whatsapp-direct {
    flex: 1 1 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    background: #25D366;
    color: #FFFFFF;
    border: none;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
    transition: all 0.2s ease;
}

.btn-whatsapp-direct:hover {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.btn-whatsapp-direct .whatsapp-icon {
    fill: #FFFFFF;
}

/* Step-by-Step Flow Banner */
.whatsapp-flow-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 22, 42, 0.85);
    border: 1px solid rgba(37, 211, 102, 0.28);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    gap: 0.5rem;
}

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

.flow-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #10B981;
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sky-blue);
    white-space: nowrap;
}

.flow-arrow {
    color: #34D399;
    font-size: 0.9rem;
}

@media (max-width: 580px) {
    .whatsapp-flow-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    .flow-arrow {
        display: none;
    }
}

.btn-subaction:disabled,
.btn-primary-action:disabled,
.btn-whatsapp-direct:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 6. WhatsApp Caption Box */
.whatsapp-caption-box {
    background: #08162A;
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
}

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

.caption-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #34D399;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    background: rgba(37, 211, 102, 0.15);
    border: 1px solid rgba(37, 211, 102, 0.4);
    color: #25D366;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(37, 211, 102, 0.3);
    color: #FFFFFF;
}

.caption-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
    white-space: pre-line;
    background: rgba(11, 31, 58, 0.6);
    padding: 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    user-select: all;
    font-family: inherit;
}

/* 7. Toast Notification */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #0F223D;
    color: #FFFFFF;
    border: 1px solid #10B981;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.35);
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: toastSlideUp 0.25s ease-out;
    transition: opacity 0.3s ease;
}

.toast.hidden {
    display: none !important;
}

@keyframes toastSlideUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   8. Dedicated High-Res 1080x1350 WhatsApp Share Card Templates
   ========================================================================== */
.render-stage {
    position: fixed;
    top: 0;
    left: -9999px;
    width: 1080px;
    height: 1350px;
    pointer-events: none;
    z-index: -9999;
    overflow: visible;
}

/* Core Card Shell: strictly 1080px x 1350px (4:5 ratio) */
.share-card {
    width: 1080px !important;
    height: max-content !important;
    min-width: 1080px !important;
    min-height: max-content !important;
    max-width: 1080px !important;
    max-height: max-content !important;
    background-color: #0B1F3A;
    color: #FFFFFF;
    padding: 68px 64px 64px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box !important;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

/* Distinct Atmospheric Glows */
.card-bg-glow {
    position: absolute;
    top: -120px;
    right: -120px;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, rgba(11, 31, 58, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.card-bg-glow.emerald {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(11, 31, 58, 0) 70%);
}

.share-card::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(30, 58, 138, 0.2) 0%, rgba(11, 31, 58, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Card Header Bar */
.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.card-branding-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    background: rgba(15, 31, 58, 0.85);
    border: 1.5px solid rgba(191, 219, 254, 0.25);
    border-radius: 40px;
}

.brand-shield {
    color: #60A5FA;
    font-size: 20px;
    line-height: 1;
}

.brand-shield.emerald {
    color: #34D399;
}

.brand-name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #DBEAFE;
    text-transform: uppercase;
}

.slide-badge {
    font-size: 18px;
    font-weight: 700;
    color: #94A3B8;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    padding: 10px 22px;
    border-radius: 40px;
    letter-spacing: 1.5px;
}

.slide-badge.offer {
    color: #34D399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Card Heading Section */
.card-heading-section {
    position: relative;
    z-index: 2;
    margin-top: 10px;
}

.card-main-title {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #FFFFFF;
    margin-bottom: 12px;
    line-height: 1.15;
}

.card-subtitle {
    font-size: 24px;
    color: #94A3B8;
    line-height: 1.4;
    font-weight: 400;
}

/* CARD 1 Form Grid */
.card-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
    z-index: 2;
    margin: 16px 0;
}

.form-field-card {
    background: rgba(15, 31, 58, 0.85);
    border: 1.5px solid rgba(191, 219, 254, 0.2);
    border-radius: 22px;
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.form-field-card.highlight-field {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(15, 31, 58, 0.95));
    border-color: rgba(96, 165, 250, 0.45);
    padding: 34px 34px;
}

.field-label-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.field-icon {
    font-size: 22px;
    color: #60A5FA;
}

.field-label {
    font-size: 19px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.field-hero-value {
    font-size: 64px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.1;
    margin-bottom: 6px;
}

.field-value {
    font-size: 38px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 6px;
}

.sub-unit {
    font-size: 22px;
    font-weight: 600;
    color: #94A3B8;
}

.field-note {
    font-size: 18px;
    color: #94A3B8;
}

.field-rule-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #BFDBFE;
    font-size: 16px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-top: 4px;
}

.rule-bullet {
    color: #60A5FA;
    font-size: 12px;
}

/* CARD 2 Hero & Timeline */
.card-outstanding-hero {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.25), rgba(15, 31, 58, 0.95));
    border: 2px solid rgba(96, 165, 250, 0.4);
    border-radius: 28px;
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 2;
}

.hero-tag {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #BFDBFE;
    display: block;
    margin-bottom: 8px;
}

.hero-amount {
    font-size: 86px;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.05;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-supporting-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(11, 25, 48, 0.65);
    padding: 10px 24px;
    border-radius: 30px;
    border: 1px solid rgba(191, 219, 254, 0.22);
}

.hero-subtitle {
    font-size: 20px;
    color: #94A3B8;
}

.hero-dot-sep {
    color: #60A5FA;
    font-size: 16px;
}

.hero-emis-callout {
    font-size: 20px;
    font-weight: 700;
    color: #60A5FA;
}

.card-timeline-section {
    background: rgba(15, 31, 58, 0.8);
    border: 1.5px solid rgba(191, 219, 254, 0.2);
    border-radius: 24px;
    padding: 30px 36px;
    position: relative;
    z-index: 2;
}

.timeline-dates-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.timeline-date-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-date-item.highlight .td-value {
    color: #60A5FA;
}

.td-label {
    font-size: 18px;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.td-value {
    font-size: 30px;
    font-weight: 800;
    color: #FFFFFF;
}

.td-connector {
    font-size: 24px;
    color: #60A5FA;
}

.card-progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-counts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.count-paid {
    font-size: 22px;
    font-weight: 800;
    color: #34D399;
}

.count-percent {
    font-size: 18px;
    font-weight: 600;
    color: #94A3B8;
}

.count-left {
    font-size: 22px;
    font-weight: 800;
    color: #60A5FA;
}

.card-progress-track {
    width: 100%;
    height: 18px;
    background: rgba(11, 25, 48, 0.9);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(191, 219, 254, 0.2);
}

.card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #10B981);
    border-radius: 12px;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.card-stats-triad {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
    position: relative;
    z-index: 2;
}

.stat-triad-card {
    background: rgba(15, 31, 58, 0.85);
    border: 1.5px solid rgba(191, 219, 254, 0.18);
    border-radius: 20px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.st-label {
    font-size: 17px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.st-value {
    font-size: 34px;
    font-weight: 800;
    color: #FFFFFF;
}

.st-sub {
    font-size: 15px;
    color: #64748B;
}

/* CARD 3 Comparison Triad & Stat Cards */
.card3-triad {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    position: relative;
    z-index: 2;
    margin-top: 14px;
    margin-bottom: 6px;
}

.card3-stat-card {
    background: rgba(15, 31, 58, 0.9);
    border: 1.5px solid rgba(52, 211, 153, 0.28);
    border-radius: 20px;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    position: relative;
}

.card3-icon-bubble {
    background: rgba(16, 185, 129, 0.2);
    border: 1.5px solid rgba(52, 211, 153, 0.4);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-weight: 800;
    font-size: 20px;
    color: #34D399;
}

.card3-stat-card .st-label {
    font-size: 15px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-cut-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 2px;
    flex-wrap: nowrap;
}

.cut-rate-tag {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-size: 13px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    text-decoration: line-through;
    text-decoration-color: #EF4444;
    text-decoration-thickness: 1.5px;
}

.cut-amount-val {
    font-size: 22px;
    font-weight: 700;
    color: #94A3B8;
    text-decoration: line-through;
    text-decoration-color: #EF4444;
    text-decoration-thickness: 2.5px;
    opacity: 0.85;
}

.stat-cut-arrow {
    color: #34D399;
    font-size: 15px;
    margin: 2px 0;
    opacity: 0.9;
}

.st-new-value {
    font-size: 32px;
    font-weight: 800;
    color: #34D399;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.st-new-sub {
    font-size: 13px;
    font-weight: 600;
    color: #93C5FD;
    margin-top: 4px;
}

/* Rate Reduction Callout */
.card-rate-reduction-callout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    align-self: center;
    background: rgba(16, 185, 129, 0.14);
    border: 1.5px solid rgba(52, 211, 153, 0.4);
    border-radius: 30px;
    padding: 10px 24px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.rate-reduction-icon {
    font-size: 20px;
}

.rate-reduction-text {
    font-size: 20px;
    font-weight: 800;
    color: #34D399;
    letter-spacing: 0.3px;
}

/* Savings Master Box */
.card-savings-master {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), rgba(15, 31, 58, 0.95));
    border: 2px solid rgba(52, 211, 153, 0.45);
    border-radius: 28px;
    padding: 30px 34px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45), 0 0 30px rgba(16, 185, 129, 0.18);
    position: relative;
    z-index: 2;
}

.savings-headline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: #34D399;
    letter-spacing: 1.5px;
    margin-bottom: 18px;
}

.sparkle-icon {
    font-size: 24px;
}

.savings-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.saving-hero-box {
    background: rgba(11, 25, 48, 0.8);
    border: 1.5px solid rgba(52, 211, 153, 0.25);
    border-radius: 20px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shb-label {
    font-size: 16px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
}

.shb-amount {
    font-size: 38px;
    font-weight: 900;
    color: #34D399;
}

.shb-friendly-note {
    font-size: 17px;
    font-weight: 600;
    color: #6EE7B7;
    margin-top: 2px;
}

.saving-total-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.35), rgba(5, 150, 105, 0.35));
    border: 1.5px solid rgba(52, 211, 153, 0.6);
    border-radius: 20px;
    padding: 20px 28px;
}

.stb-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.stb-label {
    font-size: 16px;
    font-weight: 700;
    color: #D1FAE5;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stb-amount {
    font-size: 50px;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.1;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.stb-subtext {
    font-size: 18px;
    color: #A7F3D0;
    font-weight: 500;
    margin-top: 4px;
}

/* Card 3 Refinance Terms Chips */
.card-refinance-terms {
    display: flex;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.term-chip {
    flex: 1;
    background: rgba(15, 31, 58, 0.8);
    border: 1px solid rgba(191, 219, 254, 0.18);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tc-label {
    font-size: 14px;
    color: #94A3B8;
    text-transform: uppercase;
    font-weight: 600;
}

.tc-value {
    font-size: 18px;
    color: #FFFFFF;
    font-weight: 700;
}

/* Card 3 Clean Non-Clickable Disclaimer / Clarity Line */
.card-disclaimer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: rgba(15, 31, 58, 0.65);
    border: 1px solid rgba(191, 219, 254, 0.14);
    border-radius: 16px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.card-disclaimer-bar .disclaimer-text {
    font-size: 18px;
    font-weight: 500;
    color: #94A3B8;
    margin: 0;
    letter-spacing: 0.2px;
}

/* ==========================================================================
   AUTHENTICATION & ACCESS CONTROL (LOGIN & ADMIN STYLES)
   ========================================================================== */

/* Demo / Simulation Mode Top Notification Banner */
.demo-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #1E3A8A, #2563EB, #1D4ED8);
    color: #DBEAFE;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    border-bottom: 1px solid rgba(191, 219, 254, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.demo-mode-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
}

.demo-mode-banner .badge-pill {
    background: #F59E0B;
    color: #0F172A;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Auth Cards Container (Fully Responsive) */
.auth-wrapper {
    width: 100%;
    max-width: 480px;
    margin: auto;
    padding: 0.5rem;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: clamp(18px, 4vw, 24px);
    padding: clamp(1.25rem, 5vw, 2.5rem);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.auth-header {
    text-align: center;
    margin-bottom: clamp(1.25rem, 4vw, 2rem);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(191, 219, 254, 0.25);
    color: #93C5FD;
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.auth-header h1 {
    font-size: clamp(20px, 5.5vw, 26px);
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #FFFFFF 40%, #BFDBFE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.25;
}

.auth-header p {
    color: var(--text-muted);
    font-size: clamp(12.5px, 3.5vw, 14px);
    line-height: 1.5;
}

/* Segmented Tabs (Responsive) */
.auth-tabs {
    display: flex;
    background: rgba(11, 31, 58, 0.85);
    border: 1px solid rgba(191, 219, 254, 0.15);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: clamp(18px, 4vw, 24px);
    position: relative;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    padding: clamp(8px, 2.2vw, 10px) clamp(6px, 2vw, 14px);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: clamp(12px, 3.2vw, 14px);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.auth-tab svg {
    flex-shrink: 0;
    width: clamp(14px, 3.5vw, 16px);
    height: clamp(14px, 3.5vw, 16px);
}

.auth-tab.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.auth-tab:hover:not(.active) {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

/* PIN 6-Digit Inputs (Fluid CSS Grid - Always Fits Any Mobile Screen) */
.pin-input-group {
    margin-bottom: clamp(18px, 4vw, 24px);
    width: 100%;
}

.pin-label {
    display: block;
    font-size: clamp(11px, 2.8vw, 13px);
    font-weight: 600;
    color: #CBD5E1;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 0.5px;
}

.pin-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: clamp(6px, 1.8vw, 10px);
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    justify-items: center;
}

.pin-digit {
    width: 100%;
    max-width: 54px;
    aspect-ratio: 5 / 6;
    min-height: 48px;
    background: var(--input-bg);
    border: 2px solid var(--card-border);
    border-radius: clamp(8px, 2vw, 12px);
    color: #FFFFFF;
    font-size: clamp(18px, 5.5vw, 26px);
    font-weight: 700;
    font-family: 'Inter', monospace, sans-serif;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
    caret-color: #38BDF8;
    padding: 0;
    box-sizing: border-box;
}

.pin-digit:focus {
    border-color: #38BDF8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
    background: rgba(15, 31, 58, 0.95);
    transform: translateY(-2px);
}

.pin-digit.filled {
    border-color: var(--primary);
}

/* Alert / Toast Messages */
.auth-alert {
    padding: clamp(10px, 3vw, 14px) clamp(12px, 3vw, 16px);
    border-radius: 12px;
    font-size: clamp(12.5px, 3.2vw, 14px);
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.auth-alert.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.auth-alert.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

.auth-alert.warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #FDE68A;
}

/* Action Buttons */
.auth-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.auth-btn.primary {
    background: var(--primary-gradient);
    color: #FFFFFF;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.auth-btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FFFFFF;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auth Footer */
.auth-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(191, 219, 254, 0.12);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a {
    color: #60A5FA;
    text-decoration: none;
    font-weight: 600;
}

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

/* Floating Session Pill on Main Calculator */
.session-pill-bar {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 31, 58, 0.85);
    border: 1px solid rgba(191, 219, 254, 0.2);
    backdrop-filter: blur(16px);
    border-radius: 999px;
    padding: 6px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.session-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10B981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

.session-text {
    font-size: 13px;
    font-weight: 500;
    color: #E2E8F0;
}

.session-logout-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #F87171;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.session-logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #FFFFFF;
}

/* ==========================================================================
   ADMIN DASHBOARD STYLES
   ========================================================================== */

.admin-layout {
    width: 100%;
    max-width: 960px;
    margin: 40px auto;
    position: relative;
    z-index: 10;
}

.admin-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(20px);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-brand h2 {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-email-tag {
    font-size: 13px;
    color: #94A3B8;
    background: rgba(11, 31, 58, 0.8);
    border: 1px solid rgba(191, 219, 254, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-panel-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #CBD5E1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-code-display {
    text-align: center;
    padding: 24px 16px;
    background: rgba(11, 31, 58, 0.9);
    border: 2px dashed rgba(56, 189, 248, 0.35);
    border-radius: 16px;
    margin-bottom: 20px;
}

.code-number {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 6px;
    color: #38BDF8;
    text-shadow: 0 0 24px rgba(56, 189, 248, 0.4);
    font-family: 'Inter', monospace, sans-serif;
}

.code-meta-chips {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.meta-chip {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

.meta-chip.status-active {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34D399;
}

.meta-chip.type-random {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #93C5FD;
}

.meta-chip.type-custom {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #C084FC;
}

/* Expiry Countdown Box */
.expiry-box {
    background: rgba(15, 31, 58, 0.7);
    border: 1px solid rgba(191, 219, 254, 0.15);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    margin-top: 16px;
}

.expiry-title {
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 6px;
}

.countdown-timer {
    font-size: 22px;
    font-weight: 700;
    color: #F59E0B;
    font-family: 'Inter', monospace, sans-serif;
}

.expiry-footnote {
    font-size: 11px;
    color: #64748B;
    margin-top: 4px;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS FOR AUTH & LOGIN
   ========================================================================== */

@media (max-width: 600px) {
    .demo-mode-banner {
        font-size: 11.5px;
        padding: 6px 12px;
    }

    .demo-mode-banner .banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.25rem 0.65rem;
    }

    .auth-wrapper {
        padding: 0;
        margin: auto;
    }

    .auth-card {
        padding: 1.5rem 1.15rem;
        border-radius: 18px;
    }

    .pin-inputs {
        gap: 6px;
        max-width: 100%;
    }

    .pin-digit {
        min-height: 48px;
        font-size: 20px;
    }

    .auth-tabs {
        padding: 3px;
        gap: 3px;
    }

    .auth-tab {
        padding: 8px 6px;
        font-size: 12px;
        letter-spacing: -0.2px;
    }

    .admin-navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px;
    }

    .admin-user-info {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 1rem 0.4rem;
    }

    .auth-card {
        padding: 1.25rem 0.85rem;
        border-radius: 16px;
    }

    .pin-inputs {
        gap: 4px;
    }

    .pin-digit {
        min-height: 42px;
        font-size: 18px;
        border-width: 1.5px;
    }

    .auth-tab {
        font-size: 11px;
        padding: 7px 4px;
        gap: 4px;
    }

    .auth-tab svg {
        display: none;
    }
}




