/* ================================================================
   VinFast Loan Calculator — Frontend Stylesheet v1.0
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@400;500;600;700;800&display=swap');

/* ── Variables & Reset ──────────────────────────────────────── */
.vflc-wrap {
    --vflc-blue:    #1464f4;
    --vflc-blue-dk: #0a4ecb;
    --vflc-text:    #111827;
    --vflc-muted:   #6b7280;
    --vflc-border:  #e5e7eb;
    --vflc-bg:      #ffffff;
    --vflc-card-bg: #f8fafc;
    --vflc-font:    'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
}

.vflc-wrap *,
.vflc-wrap *::before,
.vflc-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.vflc-wrap {
    font-family: var(--vflc-font);
    color: var(--vflc-text);
    background: var(--vflc-bg);
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 16px;
    line-height: 1.5;
}

/* ── Header ─────────────────────────────────────────────────── */
.vflc-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 36px;
}

.vflc-title {
    font-size: 34px;
    font-weight: 400;
    color: var(--vflc-text);
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.vflc-subtitle {
    font-size: 13px;
    color: var(--vflc-muted);
    line-height: 1.6;
}

/* ── Main Grid Layout ───────────────────────────────────────── */
.vflc-main-grid {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 40px;
    align-items: start;
}

/* ── Left Column (Logo / Financial Summary) ─────────────────── */
.vflc-left-col {
    padding-top: 10px;
}

.vflc-logo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    background: #ffffff;
    border-radius: 12px;
}

.vflc-v-logo {
    width: 140px;
    height: 140px;
    margin-bottom: 16px;
}

.vflc-logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #111827;
}

/* Summary Box */
.vflc-summary-box {
    animation: vflcFadeIn 0.3s ease;
}

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

.vflc-car-img-wrap {
    text-align: center;
    margin-bottom: 24px;
}

.vflc-summary-car-img {
    max-width: 280px;
    max-height: 170px;
    object-fit: contain;
}

.vflc-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.vflc-sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #374151;
}

.vflc-sum-row .val {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.vflc-sum-row .val.bold {
    font-weight: 700;
}

.vflc-sum-row.grand-total {
    margin-top: 6px;
}

.vflc-sum-row.grand-total .lbl {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.vflc-sum-row.grand-total .val.highlight {
    font-size: 18px;
    font-weight: 800;
    color: var(--vflc-blue);
}

.vflc-sum-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.vflc-sum-disclaimer {
    font-size: 11.5px;
    color: var(--vflc-muted);
    line-height: 1.5;
}

.vflc-sum-disclaimer a {
    color: var(--vflc-blue);
    text-decoration: underline;
}

/* ── Right Column (Form Controls Panel) ─────────────────────── */
.vflc-right-col {
    background: var(--vflc-card-bg);
    border-radius: 12px;
    padding: 24px 28px 28px;
    border: 1px solid #f1f5f9;
}

.vflc-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.vflc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vflc-field label,
.vflc-field-lbl {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.vflc-select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-family: var(--vflc-font);
    font-size: 13.5px;
    color: #111827;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%234b5563' stroke-width='2' fill='none'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.18s;
}

.vflc-select:focus {
    border-color: var(--vflc-blue);
}

/* Promo Price Radio Choice Box */
.vflc-promo-choice-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vflc-radio-box {
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.18s;
}

.vflc-radio-box.active {
    border-color: var(--vflc-blue);
    background: #ffffff;
}

.vflc-radio-lbl {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

.vflc-radio-lbl input[type="radio"] {
    accent-color: var(--vflc-blue);
    width: 16px;
    height: 16px;
}

.vflc-radio-price-val {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.vflc-promo-input-wrap {
    flex: 1;
    max-width: 170px;
}

.vflc-promo-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: var(--vflc-font);
    font-size: 12.5px;
    text-align: right;
    outline: none;
}

.vflc-promo-input:focus {
    border-color: var(--vflc-blue);
}

.vflc-promo-hint {
    font-size: 11px;
    color: var(--vflc-muted);
    line-height: 1.4;
}

.vflc-promo-hint a {
    color: var(--vflc-blue);
    text-decoration: underline;
}

/* Button Pills Row */
.vflc-pills-row {
    display: flex;
    gap: 4px;
}

.vflc-pill {
    flex: 1;
    height: 36px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: var(--vflc-font);
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.vflc-pill:hover {
    background: #f1f5f9;
}

.vflc-pill.active {
    background: #ffffff;
    border: 1.5px solid var(--vflc-blue);
    color: var(--vflc-blue);
    font-weight: 800;
}

/* Stepper Input Control */
.vflc-stepper-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    height: 42px;
    overflow: hidden;
}

.vflc-step-btn {
    width: 44px;
    height: 100%;
    background: #f8fafc;
    border: none;
    font-size: 18px;
    font-weight: 700;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vflc-step-btn:hover {
    background: #e2e8f0;
}

.vflc-stepper-input {
    flex: 1;
    height: 100%;
    border: none;
    text-align: center;
    font-family: var(--vflc-font);
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    outline: none;
    -moz-appearance: textfield;
}

.vflc-stepper-input::-webkit-outer-spin-button,
.vflc-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.vflc-stepper-suffix {
    padding-right: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
}

/* Form Submit Button */
.vflc-form-submit {
    margin-top: 6px;
}

.vflc-submit-btn {
    width: 100%;
    height: 44px;
    background: #6b7280;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-family: var(--vflc-font);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.18s;
}

.vflc-submit-btn.active {
    background: #1f2937;
}

.vflc-submit-btn.active:hover {
    background: #111827;
}

/* ── Modal Popup (Amortization Schedule Table) ───────────────── */
.vflc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: vflcFadeIn 0.2s ease;
}

.vflc-modal-card {
    background: #ffffff;
    border-radius: 10px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.vflc-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.vflc-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.vflc-modal-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vflc-btn-export {
    background: none;
    border: none;
    color: var(--vflc-blue);
    font-family: var(--vflc-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vflc-btn-export:hover {
    text-decoration: underline;
}

.vflc-modal-close {
    font-size: 24px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.vflc-modal-close:hover {
    color: #111827;
}

.vflc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.vflc-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.vflc-amort-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--vflc-font);
    font-size: 13px;
}

.vflc-amort-table th {
    background: var(--vflc-blue);
    color: #ffffff;
    font-weight: 700;
    padding: 12px 16px;
    text-align: right;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.vflc-amort-table th:first-child {
    text-align: center;
}

.vflc-amort-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
    color: #334155;
    white-space: nowrap;
}

.vflc-amort-table td:first-child {
    text-align: center;
    font-weight: 700;
    color: #1e293b;
}

.vflc-amort-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
    .vflc-main-grid {
        grid-template-columns: 1fr;
    }
    .vflc-right-col {
        padding: 20px 16px;
    }
}
