/* ========================================
   MAIN WRAPPER / ROOT VARIABLES
   Main calculator container and reusable CSS variables
   ======================================== */
.fc-wrap {
    --white: #ffffff;
    --fc-blue: #002136;
    --fc-blue-dark: #002136;
    --fc-button-hover: #009fda;
    --fc-bg: #f8f8f8;
    --fc-panel: #ffffff;
    --fc-border: #f8f8f8;
    --fc-text: #002136;
    --fc-muted: #5f6b76;
    --fc-radius: 6px;
    --fc-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);

    background: #ffffff00;
    padding: 24px;
    color: var(--fc-text);
    box-sizing: border-box;
    font-family: inherit;
    align-content: center;
    justify-content: center;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
}

/* Global box-sizing reset inside calculator */
.fc-wrap *,
.fc-wrap *::before,
.fc-wrap *::after {
    box-sizing: border-box;
}

/* Force inherited font styles on all key elements */
.fc-wrap button,
.fc-wrap input,
.fc-wrap table,
.fc-wrap th,
.fc-wrap td,
.fc-wrap a {
    font: inherit;
}

/* ========================================
   TOP SECTION LAYOUT
   Two-column layout for form panel and plans panel
   ======================================== */
.fc-wrap .fc-top {
    display: grid;
    grid-template-columns: 1.35fr 0.95fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

/* Shared card styling for main white panels */
.fc-wrap .fc-panel,
.fc-wrap .fc-plan-card {
    background: var(--fc-panel);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
}

/* Inner spacing for top left and top right panels */
.fc-wrap .fc-form-panel,
.fc-wrap .fc-plans-panel {
    padding: 28px;
    height: 100%;
}

/* ========================================
   TITLES / FIELD SPACING / LABELS
   ======================================== */
.fc-wrap .fc-main-title {
    margin: 0 0 28px;
    text-align: center;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--fc-text);
}

/* Vertical spacing between field groups */
.fc-wrap .fc-field-group + .fc-field-group {
    margin-top: 24px;
}

/* Standard label styling */
.fc-wrap .fc-label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--fc-blue);
}

/* Smaller muted text inside labels, e.g. (Months) */
.fc-wrap .fc-label span {
    font-weight: 400;
    color: var(--fc-muted);
}

/* ========================================
   INPUT FIELD + STATIC RATE BOX
   Shared styling between amount input and APR box
   ======================================== */
.fc-wrap .fc-input,
.fc-wrap .fc-static-rate {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--fc-border) !important;
    border-radius: 4px !important;
    padding: 14px 16px;
    font-size: 18px;
    line-height: 1.2;
    background: var(--white) !important;
    color: var(--fc-text) !important;
    box-shadow: none !important;
}

/* Remove native browser appearance from number input */
.fc-wrap .fc-input {
    appearance: none;
    -webkit-appearance: none;
}

/* Input focus ring / highlight */
.fc-wrap .fc-input:focus {
    outline: none;
    border-color: var(--fc-blue) !important;
    box-shadow: 0 0 0 3px rgba(13, 63, 122, 0.08) !important;
}

/* Helper text below amount input */
.fc-wrap .fc-help-text {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--fc-muted);
}

/* ========================================
   TERM BUTTON GROUP
   3 / 6 / 9 / 12 month buttons
   ======================================== */
.fc-wrap .fc-term-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--fc-border);
    border-radius: 4px;
    overflow: hidden;
}

/* Reset appearance for both term buttons and plan action buttons */
.fc-wrap .fc-term-btn,
.fc-wrap .fc-plan-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Individual term button default styling */
.fc-wrap .fc-term-btn {
    text-decoration: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-right: 1px solid var(--fc-border) !important;
    border-bottom: 1px solid var(--fc-border) !important;
    background: var(--white) !important;
    color: var(--fc-blue) !important;
    min-height: 52px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0 12px;
}

.fc-wrap .fc-term-btn:nth-last-child(-n+4) {
    border-bottom: 0;
}

/* Remove right border from last button only */
.fc-wrap .fc-term-btn:last-child {
    border-right: 0 !important;
    text-decoration: none !important;
}

/* Hover state for term buttons */
.fc-wrap .fc-term-btn:hover {
    background: #f4f7fa !important;
    text-decoration: none !important;
    color: var(--fc-blue) !important;
}

/* Active/selected term button */
.fc-wrap .fc-term-btn.active {
    background: var(--fc-blue) !important;
    color: var(--white) !important;
    font-weight: 700;
    text-decoration: none !important;
}

/* ========================================
   SUMMARY CTA BUTTON
   Apply button inside the totals block
   ======================================== */
.fc-wrap .fc-summary-action {
    margin-top: 20px;
    text-align: center;
}

/* Main summary apply button */
.fc-wrap .fc-summary-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 14px 16px;
    border-radius: 4px;
    background: #A6C23A !important;
    color: var(--white) !important;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hover/focus state for summary apply button */
.fc-wrap .fc-summary-apply:hover,
.fc-wrap .fc-summary-apply:focus {
    transition: 0.2s ease;
    background: var(--fc-blue-dark) !important;
    color: var(--white) !important;
    text-decoration: none !important;
}

/* ========================================
   STATIC APR BOX
   0% APR green bar
   ======================================== */
.fc-wrap .fc-static-rate {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fc-button-hover) !important;
    border-color: var(--fc-button-hover) !important;
    color: var(--white) !important;
    font-weight: 700;
}

/* Validation / status message under form fields */
.fc-wrap .fc-message {
    margin: 16px 0 0;
    min-height: 20px;
    font-size: 14px;
    color: #b42318;
}

/* ========================================
   PANEL HEADINGS + PLACEHOLDER
   ======================================== */
.fc-wrap .fc-panel-heading {
    margin-bottom: 22px;
}

/* Placeholder text shown before any amount is entered */
.fc-wrap .fc-plans-placeholder {
    display: block;
    padding: 24px 16px;
    text-align: center;
    color: var(--fc-muted);
    font-size: 16px;
    line-height: 1.5;
}

/* Hidden state for plans placeholder */
.fc-wrap .fc-plans-placeholder.is-hidden {
    display: none !important;
}

/* Shared heading styles for plans and summary sections */
.fc-wrap .fc-panel-heading h3,
.fc-wrap .fc-plan-header h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--fc-text);
}

/* ========================================
   TABLE WRAPPER + ENTRY ANIMATION
   ======================================== */
.fc-wrap .fc-table-wrap {
    transition: opacity 0.2s ease-in, transform 0.2s ease-in;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateY(8px);
    max-height: 420px;
    padding-right: 4px;
}

/* Visible state once plans are rendered */
.fc-wrap .fc-table-wrap.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   PLANS TABLE
   ======================================== */
.fc-wrap .fc-plans-table,
.fc-wrap .fc-plans-table-head,
.fc-wrap .fc-plans-table-body {
    width: 100%;
    border-collapse: collapse !important;
    table-layout: fixed;
    background: transparent !important;
}

/* Fixed header table spacing */
.fc-wrap .fc-plans-table-head {
    margin-bottom: 6px;
    display: none;
}

.fc-wrap .fc-plans-table-head.is-visible {
    display: table;
}

/* Keep header and body columns aligned */
.fc-wrap .fc-plans-table-head th,
.fc-wrap .fc-plans-table-body td {
    width: 25%;
}

/* Table header cells */
.fc-wrap .fc-plans-table thead th,
.fc-wrap .fc-plans-table-head thead th {
    padding: 0 12px 14px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #111827 !important;
    border: 0 0 1px 0 solid var(--fc-blue-dark)!important;
    background: #ffffff !important;
}

/* Smaller secondary line under table headings */
.fc-wrap .fc-plans-table thead th span,
.fc-wrap .fc-plans-table-head thead th span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 400;
    color: #111827 !important;
}

/* Standard table row styling */
.fc-wrap .fc-plans-table tbody tr,
.fc-wrap .fc-plans-table-body tbody tr {
    border-bottom: 1px solid var(--fc-border) !important;
    background: transparent;
}

/* Highlighted selected plan row */
.fc-wrap .fc-plans-table tbody tr.is-selected,
.fc-wrap .fc-plans-table-body tbody tr.is-selected {
    background: #eef4fb !important;
}

/* Table body cell styling */
.fc-wrap .fc-plans-table tbody td,
.fc-wrap .fc-plans-table-body tbody td {
    padding: 14px 12px;
    text-align: center;
    font-size: 16px;
    color: #111827 !important;
    vertical-align: middle;
    background: transparent !important;
    border: 0;
}

/* ========================================
   TABLE ACTION BUTTONS
   Select / Apply buttons inside rows
   ======================================== */
.fc-wrap .fc-plan-select {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    min-height: 38px;
    border: 0 !important;
    border-radius: 4px !important;
    background: var(--fc-blue) !important;
    color: var(--white) !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s ease;
    padding: 0 16px;
}

/* Default hover / focus / visited state */
.fc-wrap .fc-plan-select:hover,
.fc-wrap .fc-plan-select:focus,
.fc-wrap .fc-plan-select:visited {
    text-decoration: none !important;
    color: var(--white) !important;
    background: var(--fc-blue-dark) !important;
}

/* Apply state button */
.fc-wrap .fc-plan-select.is-apply {
    text-decoration: none !important;
    background: #A6C23A !important;
    color: var(--white) !important;
}

/* Keep apply state styling on interaction */
.fc-wrap .fc-plan-select.is-apply:hover,
.fc-wrap .fc-plan-select.is-apply:focus,
.fc-wrap .fc-plan-select.is-apply:visited {
    background: #A6C23A !important;
    color: var(--white) !important;
}

/* ========================================
   BOTTOM SUMMARY SECTION
   ======================================== */
.fc-wrap .fc-bottom {
    max-width: 100%;
}

.fc-wrap .fc-plan-header {
    margin-bottom: 14px;
}

.fc-wrap .fc-plan-card {
    overflow: hidden;
}

/* Dark summary card top section */
.fc-wrap .fc-plan-card-top {
    background: var(--fc-blue) !important;
    color: var(--white) !important;
    text-align: center;
    padding: 28px 20px 24px;
}

/* Small heading above monthly amount */
.fc-wrap .fc-plan-card-kicker {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
}

/* Monthly amount wrapper */
.fc-wrap .fc-plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 14px;
}

/* Main monthly amount figure */
.fc-wrap #fc-selected-monthly {
    font-size: 56px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
}

/* "per month" suffix */
.fc-wrap .fc-plan-price-suffix {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
}

/* APR + term text below price */
.fc-wrap .fc-plan-card-subtext {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--white);
}

/* White body section containing totals */
.fc-wrap .fc-plan-card-body {
    padding: 28px 30px;
    background: var(--white) !important;
}

/* Summary rows inside totals block */
.fc-wrap .fc-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--fc-border) !important;
    font-size: 16px;
    color: #111827 !important;
}

/* Remove last divider line */
.fc-wrap .fc-summary-row:last-child {
    border-bottom: 0;
}

/* Make right-side values slightly bolder */
.fc-wrap .fc-summary-row span:last-child {
    font-weight: 600;
}

/* ========================================
   TABLET BREAKPOINT
   ======================================== */
@media (max-width: 1024px) {
    /* Stack top layout into one column */
    .fc-wrap .fc-top {
        grid-template-columns: 1fr;
    }

    /* Slightly reduce main total size */
    .fc-wrap .fc-main-title {
        font-size: 26px;
    }

    .fc-wrap #fc-selected-monthly {
        font-size: 48px;
    }
}

/* ========================================
   MOBILE BREAKPOINT
   ======================================== */
@media (max-width: 767px) {

    /* Center align labels and titles on mobile */ 
    /* IMPORTANT, NO TOUCHING */
    .fc-wrap .fc-main-title,
    .fc-wrap .fc-panel-heading,
    .fc-wrap .fc-panel-heading h3,
    .fc-wrap .fc-plan-header,
    .fc-wrap .fc-plan-header h3,
    .fc-wrap .fc-label,
    .fc-wrap .fc-help-text,
    .fc-wrap .fc-message,
    .fc-wrap .fc-plans-placeholder {
        text-align: center;
    }

    /* Tighter outer spacing on mobile */
    .fc-wrap {
        padding: 12px;
        border-radius: 0;
    }

    /* Single-column top layout */
    .fc-wrap .fc-top {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Change duration buttons to 2x2 grid */
    .fc-wrap .fc-term-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .fc-wrap .fc-term-btn:nth-last-child(-n+2) {
    border-bottom: 0 !important;
}

    /* Reduce panel padding */
    .fc-wrap .fc-form-panel,
    .fc-wrap .fc-plans-panel {
        padding: 16px;
    }

    /* Smaller title on mobile */
    .fc-wrap .fc-main-title {
        font-size: 24px;
        margin-bottom: 22px;
    }

    /* Smaller labels */
    .fc-wrap .fc-label {
        font-size: 15px;
    }

    /* Smaller input + static APR box */
    .fc-wrap .fc-input,
    .fc-wrap .fc-static-rate {
        min-height: 46px;
        padding: 12px 14px;
        font-size: 16px;
    }

    /* Smaller term buttons */
    .fc-wrap .fc-term-btn {
        min-height: 46px;
        font-size: 16px;
    }

    /* Smaller section headings */
    .fc-wrap .fc-panel-heading h3,
    .fc-wrap .fc-plan-header h3 {
        font-size: 22px;
    }

    /* Slightly tighter table typography */
    .fc-wrap .fc-plans-table thead th,
    .fc-wrap .fc-plans-table tbody td,
    .fc-wrap .fc-plans-table-head thead th,
    .fc-wrap .fc-plans-table-body tbody td {
        font-size: 14px;
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Let the plans table scroll horizontally on mobile instead of clipping */
    .fc-wrap .fc-table-wrap {
        overflow-x: auto;
        overflow-y: auto;
        padding-right: 0;
    }

    /* Slightly tighter button sizing in the table on mobile */
    .fc-wrap .fc-plan-select {
        min-width: 72px;
        min-height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }

    /* Tighter summary card top spacing */
    .fc-wrap .fc-plan-card-top {
        padding: 22px 16px 20px;
    }

    /* Smaller summary heading text */
    .fc-wrap .fc-plan-card-kicker {
        font-size: 18px;
    }

    /* Smaller monthly amount */
    .fc-wrap #fc-selected-monthly {
        font-size: 34px;
    }

    /* Smaller "per month" suffix */
    .fc-wrap .fc-plan-price-suffix {
        font-size: 18px;
        padding-left: 2px;
    }

    /* Smaller APR + term line */
    .fc-wrap .fc-plan-card-subtext {
        font-size: 15px;
    }

    /* Tighter body padding */
    .fc-wrap .fc-plan-card-body {
        padding: 18px 16px;
    }

    /* Smaller summary rows */
    .fc-wrap .fc-summary-row {
        font-size: 15px;
    }
}