/* SNAP Calculator — adapted from EV Fee Calculator UI; CFF-safe single-shell form */

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

.cqp-wrap {
    font-family: 'Source Sans 3', 'Segoe UI', system-ui, 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; }

.snapc-brand-bar {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f7fa 55%, #fff 100%);
    border: 1px solid #e4f1f5;
    border-radius: 10px;
}
.snapc-brand-title { font-size: 1.05rem; font-weight: 800; color: #022345; letter-spacing: -0.01em; }
.snapc-brand-sub { font-size: 0.72rem; color: #6b7280; margin-top: 3px; }

.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; }
}

.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);
}

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

.cqp-calc-selector { margin-bottom: 14px; }
.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;
}

.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; }
.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-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: 2200px; transition: max-height .45s ease; }
.cqp-acc-inner { padding: 0 18px; }
.cqp-acc-open .cqp-acc-inner { padding: 18px; }

.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;
}
.cqp-badge-active { background: #022345; color: #fff; }
.cqp-badge-warn { background: #fef3c7; color: #92400e; }
.cqp-badge-no { background: #fee2e2; color: #991b1b; }
.cqp-context-line { font-size: 0.72rem; color: #6b7280; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f3f4f6; min-height: 16px; }

.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, .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; }

.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; }

.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;
}

.snapc-apply-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 12px 18px;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff !important;
    background: #0d6e4f;
    border-radius: 8px;
    text-decoration: none !important;
}
.snapc-apply-btn:hover { background: #0a5a41; color: #fff !important; }

.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;
    margin-bottom: 10px;
}
.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;
}
.cqp-email-btn:hover { background: #03305e; }
.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; }

.snapc-status-msg {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 0.8rem;
    line-height: 1.45;
}
.snapc-status-likely { background: #dcfce7; color: #166534; }
.snapc-status-uncertain { background: #fef3c7; color: #92400e; }
.snapc-status-no { background: #fee2e2; color: #991b1b; }
