/* EV Fee Calculator — 2026 California vehicle registration fee estimator */

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

.cqp-wrap {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    color: #1a202c;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.cqp-wrap input, .cqp-wrap select, .cqp-wrap button { font-family: inherit; }

/* Layout */
.cqp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 860px) {
    .cqp-layout { display: flex; flex-direction: column; }
    .cqp-form-col { order: 1; width: 100%; }
    .cqp-results-col { order: 2; width: 100%; position: static; }
}

/* Fields */
.cqp-field-group { margin-bottom: 14px; }
.cqp-field-group:last-child { margin-bottom: 0; }
.cqp-label { display: block; font-size: 0.78rem; font-weight: 600; color: #374151; margin-bottom: 5px; }
.cqp-field-help { font-size: 0.70rem; color: #6b7280; margin-top: 4px; line-height: 1.45; }

.cqp-input-wrap { position: relative; }
.cqp-input-prefix { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 0.82rem; pointer-events: none; }
.cqp-has-prefix .cqp-input { padding-left: 24px; }

.cqp-input, .cqp-select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 0.84rem;
    color: #1a202c;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cqp-input:focus, .cqp-select:focus {
    outline: none;
    border-color: #022345;
    box-shadow: 0 0 0 3px rgba(2,35,69,0.1);
}

/* Grid */
.cqp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .cqp-grid-2 { grid-template-columns: 1fr; } }

/* County selector */
.cqp-calc-selector { margin-bottom: 18px; }
.cqp-calc-label {
    display: block;
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
    margin-bottom: 6px;
}
.cqp-calc-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #022345;
    background: #fff;
    border: 1px solid #e4f1f5;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 4.5L6 9 10.5 4.5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
}

/* Accordion */
.cqp-acc { background: #fff; border: 1px solid #e4f1f5; border-radius: 10px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(2,35,69,.06); }
.cqp-acc-hd {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    gap: 10px;
}
.cqp-acc-hd:hover, .cqp-acc-hd:focus { background: #E4F1F5; }
.cqp-acc-hd-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cqp-acc-title { display: block; font-size: 0.88rem; font-weight: 700; color: #022345; }
.cqp-acc-sub { display: block; font-size: 0.70rem; color: #6b7280; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cqp-badge {
    background: #022345;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.cqp-badge-muted { background: #e4f1f5; color: #022345; }
.cqp-acc-open .cqp-badge-muted { background: #022345; color: #fff; }
.cqp-chevron { width: 18px; height: 18px; color: #9ca3af; flex-shrink: 0; transition: transform .25s ease; }
.cqp-acc-open .cqp-chevron { transform: rotate(180deg); color: #022345; }
.cqp-acc-body { position: relative; overflow: hidden; max-height: 0; transition: max-height .32s ease; }
.cqp-acc-open .cqp-acc-body { max-height: 1600px; transition: max-height .45s ease; }
.cqp-acc-inner { padding: 0 18px; }
.cqp-acc-open .cqp-acc-inner { padding: 18px; }

/* Results panel */
.cqp-results-col { position: sticky; top: 84px; }
.cqp-results-panel {
    background: #fff;
    border: 1px solid #e4f1f5;
    border-top: 4px solid #022345;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(2,35,69,.10);
}
.cqp-results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e4f1f5;
    gap: 8px;
    flex-wrap: wrap;
}
.cqp-results-title { font-size: 0.92rem; font-weight: 700; color: #022345; }
.cqp-results-sub { font-size: 0.70rem; color: #6b7280; margin-top: 2px; }
.cqp-badge-status {
    display: inline-block;
    border-radius: 20px;
    padding: 3px 10px;
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}
.cqp-badge-active { background: #022345; color: #fff; }
.cqp-context-line { font-size: 0.72rem; color: #6b7280; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f3f4f6; min-height: 16px; }

/* Result rows */
.cqp-r-section-head { background: #f8fafc; border-radius: 5px; padding: 5px 10px; margin: 10px 0 2px; }
.cqp-r-section-head .cqp-r-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #022345; }
.cqp-r-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    font-size: 0.82rem;
    gap: 8px;
}
.cqp-r-row + .cqp-r-row { border-top: 1px solid #f3f4f6; }
.cqp-r-left { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cqp-r-label { color: #374151; font-weight: 500; }
.cqp-r-note { font-size: 0.68rem; color: #6b7280; margin-top: 1px; }
.cqp-r-val { font-weight: 600; color: #1a202c; white-space: nowrap; text-align: right; min-width: 88px; }
.cqp-r-subtotal { border-top: 1px solid #e5e7eb !important; padding-top: 9px !important; margin-top: 4px; }
.cqp-r-subtotal .cqp-r-label { font-weight: 700; color: #022345; }
.cqp-r-subtotal .cqp-r-val { font-weight: 700; color: #022345; }
.cqp-r-total { border-top: 2px solid #022345 !important; padding-top: 12px !important; margin-top: 6px; font-size: 1.02rem; }
.cqp-r-total .cqp-r-label { font-weight: 700; color: #022345; }
.cqp-r-total .cqp-r-val { font-weight: 800; color: #022345; }

/* Checkbox flags (Virginia) */
.cqp-flags-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e4f1f5;
    border-radius: 8px;
}
.cqp-flag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.cqp-flag-row:last-child { margin-bottom: 0; }
.cqp-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #022345;
    cursor: pointer;
    flex-shrink: 0;
}
.cqp-flag-row label {
    font-size: 0.78rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

/* Rate hint / disclaimer */
.cqp-rate-hint {
    background: #f0f9ff;
    border: 1px solid #A4DFF5;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 0.74rem;
    color: #022345;
    line-height: 1.65;
    margin-top: 14px;
}

/* Email capture */
.cqp-email-capture {
    margin-top: 20px;
    padding: 18px 20px 14px;
    background: #f0f6ff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
}
.cqp-email-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font-size: 0.9rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    outline: none;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}
.cqp-email-input::placeholder { color: #9ca3af; }
.cqp-email-input:focus { border-color: #022345; box-shadow: 0 0 0 3px rgba(2,35,69,0.08); }
.cqp-email-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    background: #022345;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.15s, opacity 0.15s;
}
.cqp-email-btn:hover, .cqp-email-btn:focus { background: #03305e; color: #fff; }
.cqp-email-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.cqp-email-msg {
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}
.cqp-email-msg-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.cqp-email-msg-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Responsive */
@media (max-width: 600px) {
    .cqp-results-panel { padding: 14px; border-radius: 8px; }
    .cqp-results-header { margin-bottom: 12px; padding-bottom: 10px; }
    .cqp-results-title { font-size: 0.86rem; }
    .cqp-results-sub { font-size: 0.68rem; }
    .cqp-r-row { font-size: 0.80rem; padding: 6px 0; }
    .cqp-r-label { font-size: 0.78rem; }
    .cqp-r-note { font-size: 0.66rem; }
    .cqp-r-val { font-size: 0.80rem; min-width: 70px; }
    .cqp-r-total { font-size: 0.96rem; }
}
