
/* Mortrage section css starts */
.mortgage-form {
    margin-bottom: var(--space-8);
}

.mortgage-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.mortgage-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.mortgage-field label {
    font-size: 14px;
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.mortgage-input {
    width: 100%;
    padding: 12px 12px 12px 50px;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.mortgage-calculate-btn {
    width: 100%;
    padding: 16px;
    background: var(--btn-dark-bg);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: var(--font-semibold);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: background var(--transition-fast);
}

.mortgage-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.mortgage-card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.mortgage-card h3 {
    font-size: 18px;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.result-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-value {
    font-size: 18px;
    font-weight: var(--font-bold);
    color: var(--text-primary);
}
.mortgage-calculator-section {
    
    border: solid 1px #ccc;
    padding: 15px;
    border-radius: 15px;
    background: #f9f9f9;

}

.mortgage-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tenure-radio-group {
    display: flex;
    gap: 12px;
}

.tenure-radio {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
}

.tenure-radio input {
    accent-color: #2563eb; /* match theme */
}

/**Cal**/
.mortgage-result-box {
    display: flex;
    background: #fff;
    border-radius: 12px;
    margin-top: 25px;
    padding: 25px;
    box-shadow: 0 4px 16px rgb(0 0 0 / 25%);
    position: relative;
    z-index: 2;
}

/* LEFT SIDE */
.mortgage-result-left {
    width: 55%;
    padding-right: 25px;
}

.result-item {
    margin-bottom: 22px;
}

.result-item .label {
    display: block;
    font-size: 16px;
    color: #666;
    margin-bottom: 6px;
}

.result-item .value {
    font-size: 22px;
    font-weight: 600;
    color: #222;
}

.result-item .value.interest {
    color: #e74c3c;
}

.result-item .value.total {
    color: #2c3e50;
}

/* RIGHT SIDE */
.mortgage-result-right {
    width: 45%;
    padding-left: 25px;
    border-left: 1px dashed #ddd;
    text-align: center;
}

/* CIRCLE CHART */
.emi-chart {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: conic-gradient(
        #2ecc71 0% 60%,
        #e74c3c 60% 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-center {
    width: 110px;
    height: 110px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* LEGEND */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 13px;
}

.legend {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend.principal {
    background: #2ecc71;
}

.legend.interest {
    background: #e74c3c;
}
.mortgage-calculator-section h4 {
    margin-bottom: 20px;
}

/* ===============================
   CARD STACK WRAPPER BEHAVIOR
   =============================== */

.amortization-section {
    position: relative;
    margin-top: -50px; /* card peeking from bottom */
    z-index: 1;

    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 20px rgb(0 0 0 / 20%);
    transition: transform 0.4s ease, z-index 0.3s ease;
}

/* ===============================
   TOGGLE BUTTON = CARD HANDLE
   =============================== */

.amortization-toggle-wrap {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 10px;
    margin-top: 60px;
}

.amortization-toggle-btn {
    background: #f4f6f8;
    border: none;
    padding: 10px 18px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgb(0 0 0 / 15%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===============================
   HIDE TABLE BEHIND BUTTON
   =============================== */

.amortization-wrapper {
/*    max-height: 0;*/
    overflow: hidden;
/*    opacity: 0;*/
    transform: translateY(-12px);
    transition: all 0.4s ease;
}

/* ===============================
   EXPANDED STATE (ON CLICK)
   =============================== */

.amortization-section.active .amortization-wrapper {
    max-height: 1500px;
    opacity: 1;
    transform: translateY(0);
}

/* ===============================
   OPTIONAL: DEPTH SHADOW EFFECT
   =============================== */

.mortgage-result-box::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: -12px;
    height: 20px;
    background: rgba(0, 0, 0, 0.12);
    filter: blur(14px);
    z-index: -1;
}

/* ===============================
   HIDDEN CONTENT VISUAL HINT
   =============================== */

/* Create stacking context */
.amortization-section {
    overflow: hidden; /* keeps overlay inside card */
}

/* Button always above everything */
.amortization-toggle-wrap {
    position: relative;
    z-index: 5;
}

/* Table stays visually behind button */
.amortization-wrapper {
    position: relative;
    z-index: 1;
}

/* Gradient overlay hinting hidden data */
.amortization-section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 95px; /* just below toggle button */
    height: 140px;

    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.95),
        rgba(255, 255, 255, 0.85),
        rgba(255, 255, 255, 0)
    );

    pointer-events: none;
    z-index: 3;
    transition: opacity 0.3s ease;
}

/* Remove overlay when expanded */
.amortization-section.active::after {
    opacity: 0;
}

/* ===============================
   OPTIONAL UX POLISH (RECOMMENDED)
   =============================== */

/* Subtle attention cue on button */
.amortization-toggle-btn {
    animation: amortization-pulse 2.2s infinite;
}

@keyframes amortization-pulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* ===============================
   AMORTIZATION TABLE STYLING
   =============================== */

.amortization-table-wrapper {
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e6e6e6;
}

/* TABLE BASE */
.amortization-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

/* HEADER */
.amortization-table thead th {
    background: #f5f7fa;
    color: #333;
    font-weight: 600;
    text-align: right;
    padding: 12px 14px;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* FIRST COLUMN LEFT ALIGN */
.amortization-table thead th:first-child,
.amortization-table tbody td:first-child {
    text-align: left;
}

/* BODY CELLS */
.amortization-table tbody td {
    padding: 11px 14px;
    text-align: right;
    border-bottom: 1px solid #eee;
    color: #444;
    white-space: nowrap;
}

/* ZEBRA STRIPES */
.amortization-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* ROW HOVER */
.amortization-table tbody tr:hover {
    background: #eef5ff;
}

/* ===============================
   COLUMN COLOR HINTS
   =============================== */

.amortization-table tbody td:nth-child(4) {
    color: #2ecc71; /* Principal */
    font-weight: 600;
}

.amortization-table tbody td:nth-child(5) {
    color: #e74c3c; /* Interest */
    font-weight: 600;
}

/* ===============================
   SCROLLABLE TABLE (LARGE DATA)
   =============================== */

.amortization-table-wrapper {
    max-height: 380px;
    overflow: auto;
}

/* Custom scrollbar (Webkit) */
.amortization-table-wrapper::-webkit-scrollbar {
    width: 6px;
}

.amortization-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.amortization-table-wrapper::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

/* ===============================
   MOBILE OPTIMIZATION
   =============================== */

@media (max-width: 768px) {
    .amortization-table {
        font-size: 12px;
    }

    .amortization-table thead th,
    .amortization-table tbody td {
        padding: 10px 10px;
    }
}

/* ===============================
   CHEVRON ROTATION FIX
   =============================== */

/* Ensure icon wrapper can rotate */
.amortization-toggle-btn .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    transform-origin: center;
}

/* Rotate when expanded */
.amortization-toggle-btn[aria-expanded="true"] .btn-icon {
    transform: rotate(180deg);
}

/* Force SVG to follow parent transform */
.amortization-toggle-btn .btn-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}
.amortization-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.amort-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 576px) {
    .mortgage-result-box{
        flex-direction: column;
        gap: 20px;
    }
}
.amount-words {
    font-size: 12px;
    color: #666;
    font-style: italic;
}
#homeloan h3 {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 16px;
    font-size: 16px;
    font-weight: var(--font-medium);
    color: var(--text-primary);
    padding-right: 10px;
    border-right: 1px solid #ccc;
}

.input-link {
    position: absolute;
    right: 16px;
    font-size: 13px;
    color: #6366F1;
    text-decoration: none;
    white-space: nowrap;
}


.amount-words.inline {
    position: absolute;
    right: 0;
    padding-right: 10px;
}


.emi-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mortgage-emi-note-wrap {
    position: relative;
    display: inline-flex;
}

.emi-info-icon {
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mortgage-emi-note {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    width: 260px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 20;
}

.mortgage-emi-note-wrap:hover .mortgage-emi-note {
    opacity: 1;
    visibility: visible;
}

.mortgage-input:focus {
    outline: none;
    border-color: #6366F1;
}

.input-link:hover {
    text-decoration: underline;
}

.mortgage-calculate-btn:hover {
    background: var(--btn-dark-hover);
}

.mortgage-card:hover {
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.progress-label {
    position: relative;
    z-index: 1;
}

@media (max-width: 767px) {
    .mortgage-form {
        margin-bottom: var(--space-5);
    }

    .mortgage-row {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        margin-bottom: var(--space-4);
    }

    .mortgage-field label {
        font-size: 13px;
    }

    .input-prefix {
        left: 14px;
        font-size: 15px;
        padding-right: 8px;
    }

    .mortgage-input {
        padding: 11px 11px 11px 46px;
        font-size: 15px;
    }

    #loanTenure {
        padding-left: 70px;
    }

    .input-link {
        right: 14px;
        font-size: 12px;
    }

    .mortgage-calculate-btn {
        padding: 13px;
        font-size: 14px;
    }

    .mortgage-results {
        gap: var(--space-4);
    }

    .mortgage-card {
        padding: var(--space-4);
    }

    .mortgage-card h3 {
        font-size: 16px;
        margin-bottom: var(--space-2);
    }

    .result-row {
        margin-bottom: var(--space-4);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .result-label {
        font-size: 13px;
    }

    .result-value {
        font-size: 16px;
    }

    .progress-bar {
        height: 36px;
        margin-bottom: var(--space-3);
    }

    .progress-segment {
        font-size: 13px;
    }

    .progress-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .legend-item {
        font-size: 13px;
    }
}

@media (max-width: 479px) {
    .mortgage-card h3 {
        font-size: 15px;
    }

    .result-value {
        font-size: 15px;
    }

    .progress-bar {
        height: 32px;
    }

    .progress-segment {
        font-size: 12px;
    }

    .legend-item {
        font-size: 12px;
    }
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
