/* Financing Calculator — iframe-friendly, mobile-first */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #f5f6f8;
    font-family: 'Saira', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.fc { padding: 16px; }

.fc-warning {
    max-width: 1080px;
    margin: 0 auto 16px;

    background: #fff;
    text-align: center;
}
.fc-warning img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.fc-app {
    max-width: 1080px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.fc-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
}
.fc-header h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.fc-intro { margin: 0; color: #666; font-size: 14px; }

.fc-step { padding: 24px; }

/* Grid layout: form left, summary right */
.fc-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}
@media (min-width: 760px) {
    .fc-grid { grid-template-columns: 1.2fr 1fr; align-items: start; }
}

/* Form */
.fc-form h2 { margin: 0 0 16px; font-size: 18px; font-weight: 600; }

.fc-field { margin-bottom: 16px; }
.fc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fc-field-row .fc-field-2 { grid-column: span 1; }
@media (min-width: 480px) {
    .fc-field-row .fc-field-2 { grid-column: span 1; }
}

.fc-field label, .fc-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}
.fc-help { display: block; margin-top: 4px; font-size: 12px; color: #888; }

.fc-field input[type="text"],
.fc-field input[type="email"],
.fc-field input[type="tel"],
.fc-field input[type="number"],
.fc-field select,
.fc-field textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #d0d4d9;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.fc-field input:focus,
.fc-field select:focus,
.fc-field textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.12);
}

.fc-input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid #d0d4d9;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.fc-input-prefix:focus-within { border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(26,26,26,0.12); }
.fc-input-prefix span {
    padding: 0 12px;
    background: #f5f6f8;
    color: #666;
    font-weight: 500;
    align-self: stretch;
    display: flex;
    align-items: center;
    border-right: 1px solid #d0d4d9;
}
.fc-input-prefix input {
    border: none !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
}

/* Info icon */
.fc-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin-left: 4px;
    border: 1px solid #999;
    border-radius: 50%;
    background: transparent;
    color: #666;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    transition: background .15s, color .15s, border-color .15s;
}
.fc-info:hover,
.fc-info:focus {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    outline: none;
}

/* Floating tooltip bubble (JS-positioned) */
.fc-tooltip-bubble {
    position: fixed;
    max-width: 240px;
    padding: 8px 10px;
    background: #1a1a1a;
    color: #fff;
    font-family: 'Saira', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 6px;
    text-align: left;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity .15s;
}
.fc-tooltip-bubble[data-visible="true"] { opacity: 1; }
.fc-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}
.fc-tooltip-bubble[data-placement="top"] .fc-tooltip-arrow {
    bottom: -12px;
    border-top-color: #1a1a1a;
}
.fc-tooltip-bubble[data-placement="bottom"] .fc-tooltip-arrow {
    top: -12px;
    border-bottom-color: #1a1a1a;
}

/* Term pills */
.fc-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-pill {
    position: relative;
    cursor: pointer;
}
.fc-pill input { position: absolute; opacity: 0; pointer-events: none; }
.fc-pill span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #d0d4d9;
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
}
.fc-pill input:checked + span {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}
.fc-pill:hover span { border-color: #999; }

.fc-radio-row { display: flex; gap: 16px; }
.fc-radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }

.fc-field-checkbox label { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; cursor: pointer; }
.fc-field-checkbox input { margin-top: 4px; }

/* Summary panel */
.fc-summary {
    position: sticky;
    top: 16px;
}
.fc-summary-panel {
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}
.fc-summary-panel h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }

.fc-summary-list { margin: 0; padding: 0; }
.fc-summary-list .fc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eef0f3;
    font-size: 14px;
}
.fc-summary-list .fc-row:last-child { border-bottom: none; }
.fc-summary-list dt { margin: 0; color: #555; }
.fc-summary-list dd { margin: 0; font-weight: 500; }

.fc-row-highlight {
    margin: 8px -8px;
    padding: 12px 8px !important;
    background: #fff7d6;
    border-radius: 6px;
    border-bottom: none !important;
}
.fc-row-highlight dt { font-weight: 600; color: #1a1a1a !important; }
.fc-row-highlight dd { font-size: 18px !important; font-weight: 700; color: #1a1a1a; }

/* Buttons */
.fc-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s, transform .05s;
    text-align: center;
}
.fc-btn:hover { opacity: 0.9; }
.fc-btn:active { transform: translateY(1px); }
.fc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.fc-btn-primary {
    background: #1a1a1a;
    color: #fff;
    width: 100%;
}
.fc-btn-secondary {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
}

.fc-btn-link {
    background: none;
    border: none;
    color: #1a73e8;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
    text-decoration: underline;
}
.fc-btn-link:hover { color: #0c5dc7; }

/* Quote step */
.fc-quote h2 { margin: 16px 0; font-size: 20px; font-weight: 600; }
.fc-summary-recap { margin-bottom: 24px; }

.fc-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 24px;
}
.fc-fieldset legend {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0;
}

.fc-search-row { display: flex; gap: 8px; }
.fc-search-row input { flex: 1; }
.fc-search-row button { white-space: nowrap; }

/* Dealer search input with search icon */
.fc-dealer-search > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}
.fc-search-input {
    position: relative;
    margin-top: 6px;
}
.fc-search-input .fc-search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
    transition: color .15s;
}
.fc-search-input input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-size: 15px;
    border: 1px solid #d0d4d9;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.fc-search-input input::placeholder { color: #999; }
.fc-search-input input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.12);
}
.fc-search-input:focus-within .fc-search-icon { color: #1a1a1a; }

/* Google Maps Places dropdown */
.pac-container {
    z-index: 10000 !important;
    margin-top: 4px;
    border: 1px solid #d0d4d9;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    font-family: 'Saira', -apple-system, sans-serif;
}
.pac-item {
    padding: 8px 12px;
    border-top: 1px solid #f0f1f3;
    font-size: 14px;
    cursor: pointer;
}
.pac-item:first-child { border-top: none; }
.pac-item:hover,
.pac-item-selected { background: #fafbfc; }
.pac-icon { margin-right: 8px; }
.pac-matched { font-weight: 600; }

.fc-dealer-results {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}
.fc-dealer-option {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid #d0d4d9;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.fc-dealer-option:has(input:checked),
.fc-dealer-option:hover {
    border-color: #1a1a1a;
    background: #fafbfc;
}
.fc-dealer-option input { margin-top: 4px; }
.fc-dealer-line { font-size: 14px; line-height: 1.4; }

.fc-dealer-card {
    padding: 14px;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.fc-submit-row { margin-top: 24px; }

.fc-error {
    color: #c0392b;
    font-size: 13px;
    margin-top: 8px;
}

/* Success */
.fc-success { text-align: center; padding: 24px 0; }
.fc-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2ecc71;
    color: #fff;
    font-size: 32px;
    margin-bottom: 16px;
}
.fc-success h2 { margin: 0 0 8px; font-size: 22px; font-weight: 600; }
.fc-success p { margin: 0 0 24px; color: #555; }

/* Footer */
.fc-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #eee;
}
.fc-disclaimer {
    margin: 0;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

/* Representative example (AFM disclosure) */
.fc-representative-example {
    margin-top: 24px;
    padding: 16px 0 0;
    border-top: 1px solid #eee;
}
.fc-re-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 16px;
}
.fc-re-cell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.fc-re-label {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}
.fc-re-value {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}
.fc-re-total {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fc-re-total-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}
.fc-re-total-value {
    font-size: 14px;
    color: #1a1a1a;
}

@media (max-width: 960px) {
    .fc-re-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .fc-re-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
