/* ================================================================
   DUI Cost Estimator — dui-calculator.css
   Mobile-first. Scoped to .dui-wrap
   Design: Deep indigo headers, white cards, strong contrast results
   ================================================================ */

.dui-wrap *, .dui-wrap *::before, .dui-wrap *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}
.dui-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px; color: #1e293b;
    max-width: 960px; margin: 0 auto;
    background: #fff; border-radius: 16px;
    border: 1px solid #e2e8f0; overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────── */
.dui-header {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 24px; background: #1e1b4b;
    border-bottom: none;
}
.dui-header-icon {
    width: 44px; height: 44px; background: rgba(255,255,255,.12);
    border-radius: 10px; display: flex; align-items: center;
    justify-content: center; color: #a5b4fc; flex-shrink: 0;
}
.dui-title    { font-size: 19px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.dui-subtitle { font-size: 12.5px; color: #a5b4fc; }

/* ── Body layout ──────────────────────────────────────────── */
.dui-body { display: flex; flex-direction: column; }
@media (min-width: 720px) {
    .dui-body    { flex-direction: row; align-items: flex-start; }
    .dui-form    { width: 52%; border-right: 1px solid #e2e8f0; }
    .dui-results { width: 48%; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
}

/* ── Form ─────────────────────────────────────────────────── */
.dui-form  { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.dui-field { display: flex; flex-direction: column; gap: 6px; }
.dui-label { font-size: 12.5px; font-weight: 700; color: #334155; text-transform: uppercase; letter-spacing: .05em; }
.dui-hint  { font-size: 11.5px; color: #94a3b8; }

/* Select */
.dui-select {
    width: 100%; padding: 10px 32px 10px 14px; height: 46px;
    border: 1.5px solid #cbd5e1; border-radius: 10px;
    font-size: 14px; color: #1e293b; background: #f8fafc;
    appearance: none; outline: 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 fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    transition: border-color .18s;
}
.dui-select:focus { border-color: #4f46e5; background-color: #fff; }

/* Button group choices */
.dui-btn-group   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dui-btn-group-2 { grid-template-columns: repeat(2, 1fr); }
.dui-choice {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 10px 8px; border: 1.5px solid #e2e8f0;
    border-radius: 10px; background: #f8fafc; font-size: 13px;
    font-weight: 600; color: #475569; cursor: pointer;
    transition: all .15s; line-height: 1.3; text-align: center;
}
.dui-choice:hover  { border-color: #4f46e5; color: #4f46e5; background: #f5f3ff; }
.dui-choice.active { background: #1e1b4b; border-color: #1e1b4b; color: #fff; }
.dui-choice-sub    { font-size: 11px; font-weight: 400; opacity: .75; }

/* Input prefix */
.dui-prefix-wrap {
    display: flex; align-items: center;
    border: 1.5px solid #cbd5e1; border-radius: 10px;
    overflow: hidden; background: #f8fafc; transition: border-color .18s;
}
.dui-prefix-wrap:focus-within { border-color: #4f46e5; background: #fff; }
.dui-prefix {
    padding: 0 12px; font-size: 14px; font-weight: 600; color: #64748b;
    background: #f1f5f9; height: 46px; display: flex; align-items: center;
    border-right: 1px solid #e2e8f0; flex-shrink: 0;
}
.dui-input {
    flex: 1; border: none; background: transparent; padding: 0 14px;
    height: 46px; font-size: 14px; color: #1e293b; outline: none;
    -moz-appearance: textfield;
}
.dui-input::-webkit-outer-spin-button,
.dui-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Disclaimer */
.dui-disclaimer {
    display: flex; align-items: flex-start; gap: 8px;
    background: #fefce8; border: 1px solid #fde047;
    border-radius: 9px; padding: 10px 14px;
    font-size: 12.5px; color: #854d0e; line-height: 1.5;
}
.dui-disclaimer svg { flex-shrink: 0; margin-top: 1px; color: #ca8a04; }

/* ── Results ──────────────────────────────────────────────── */
.dui-results { background: #f8fafc; padding: 20px; }

.dui-result-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 280px; gap: 14px;
    color: #94a3b8; text-align: center;
}
.dui-result-placeholder p { font-size: 13.5px; line-height: 1.6; max-width: 220px; }

/* Hero result */
.dui-hero {
    background: #1e1b4b; border-radius: 14px; padding: 22px;
    text-align: center; margin-bottom: 16px;
}
.dui-hero-label  { font-size: 11px; font-weight: 700; color: #a5b4fc; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.dui-hero-amount { font-size: 52px; font-weight: 800; color: #fff; letter-spacing: -.03em; line-height: 1; }
.dui-hero-sub    { font-size: 12.5px; color: #818cf8; margin-top: 6px; }

/* Breakdown */
.dui-breakdown {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 16px; margin-bottom: 14px;
}
.dui-breakdown-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 14px; }

.dui-br-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12.5px; color: #475569; margin-bottom: 4px;
}
.dui-br-left   { display: flex; align-items: center; gap: 8px; }
.dui-br-dot    { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dui-br-name   { color: #334155; }
.dui-br-amount { font-weight: 700; color: #1e293b; font-size: 13px; }
.dui-br-bar-wrap { height: 4px; background: #f1f5f9; border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.dui-br-bar    { height: 100%; border-radius: 4px; width: 0%; transition: width .5s ease; }

/* Insight box */
.dui-insight {
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.dui-insight-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; color: #15803d;
    margin-bottom: 5px; text-transform: uppercase; letter-spacing: .05em;
}
.dui-insight-text { font-size: 12.5px; color: #166534; line-height: 1.6; }

/* 5-year total */
.dui-fiveyear {
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 12px; padding: 16px; text-align: center;
}
.dui-fiveyear-label  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #991b1b; margin-bottom: 6px; }
.dui-fiveyear-amount { font-size: 32px; font-weight: 800; color: #dc2626; letter-spacing: -.02em; margin-bottom: 4px; }
.dui-fiveyear-sub    { font-size: 11.5px; color: #b91c1c; line-height: 1.5; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .dui-header  { padding: 16px; }
    .dui-form, .dui-results { padding: 16px; }
    .dui-title   { font-size: 17px; }
    .dui-hero-amount { font-size: 42px; }
    .dui-btn-group   { grid-template-columns: repeat(3, 1fr); }
    .dui-btn-group-2 { grid-template-columns: 1fr 1fr; }
    .dui-choice  { font-size: 12px; padding: 8px 6px; }
}

/* ── Toggle switches ──────────────────────────────────────── */
.dui-toggle-row {
    display: flex; flex-direction: column; gap: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 14px;
}
.dui-toggle-item {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; cursor: pointer;
}
.dui-toggle-text  { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.dui-toggle-label { font-size: 13px; font-weight: 600; color: #334155; }
.dui-toggle-sub   { font-size: 11.5px; color: #94a3b8; line-height: 1.4; }
.dui-switch-wrap  { flex-shrink: 0; position: relative; width: 44px; height: 24px; }
.dui-switch-input { opacity: 0; width: 0; height: 0; position: absolute; }
.dui-switch-track {
    position: absolute; inset: 0; background: #e2e8f0;
    border-radius: 24px; transition: background .2s; cursor: pointer;
}
.dui-switch-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; background: #fff;
    border-radius: 50%; transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.dui-switch-input:checked + .dui-switch-track { background: #1e1b4b; }
.dui-switch-input:checked + .dui-switch-track::after { transform: translateX(20px); }

/* Modifier flags */
.dui-flags {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.dui-flag {
    display: inline-flex; align-items: center;
    font-size: 11.5px; font-weight: 700;
    padding: 4px 12px; border-radius: 20px;
}
.dui-flag-refusal  { background: #fef3c7; color: #92400e; }
.dui-flag-accident { background: #fee2e2; color: #991b1b; }

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .dui-form    { display: none !important; }
    .dui-body    { display: block; }
    .dui-results { width: 100%; background: #fff; padding: 0; }
    .dui-wrap    { border: none; border-radius: 0; }
    .dui-header  { background: #1e1b4b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
