.vl-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.vl-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.vl-input {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.vl-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.vl-input:disabled {
    background-color: #f9fafb;
    cursor: not-allowed;
}

.progress-bar-animated {
    background: linear-gradient(90deg, #4f46e5, #818cf8, #4f46e5);
    background-size: 200% 100%;
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.tab-active {
    border-color: #4f46e5 !important;
    color: #4f46e5 !important;
}

.collapsible-content {
    transition: max-height 0.3s ease;
}

.chevron-open {
    transform: rotate(180deg);
}

.upload-zone .border-dashed {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    max-width: 24rem;
}

.notification-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.notification-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.notification-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (max-width: 768px) {
    .tab-btn {
        font-size: 0.75rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

select.vl-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* ============================================================
   SwarmAI design tokens + v2 components (input redesign)
   Legacy .vl-* classes above are untouched; status/result
   still use them. New pages consume the tokens below.
   ============================================================ */

:root {
    --ink: #141a3c;
    --ink-soft: #3a4066;
    --muted: #6b7191;
    --faint: #9aa0bd;
    --line: #e8e5f2;
    --line-strong: #d9d5ea;
    --canvas: #f4f2fb;
    --surface: #ffffff;
    --brand: #12a674;
    --brand-ink: #0b7a56;
    --brand-tint: #e7f7f0;
    --link: #4457d6;
    --danger: #e0546a;
    --radius-card: 22px;
    --radius-field: 12px;
    --shadow-card: 0 1px 2px rgba(20, 26, 60, 0.04), 0 12px 32px -18px rgba(20, 26, 60, 0.22);
    --shadow-cta: 0 10px 24px -10px rgba(20, 26, 60, 0.55);
}

body {
    background:
        radial-gradient(120% 80% at 50% -10%, #efeaff 0%, rgba(239, 234, 255, 0) 55%),
        linear-gradient(180deg, #f6f4fd 0%, #fbfaff 100%);
    background-attachment: fixed;
    color: var(--ink);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(251, 250, 255, 0.72);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.app-footer {
    border-top: 1px solid var(--line);
}

/* ---- Hero ---- */
.hero-title {
    font-family: '"Bricolage Grotesque"', 'Bricolage Grotesque', system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(2.3rem, 5.2vw, 3.55rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: var(--ink);
}

.hero-sub {
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.18rem);
}

/* ---- Grouped panel / card ---- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.panel-flush {
    background: transparent;
}

.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ---- Fields ---- */
.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.4rem;
}
.field-label .opt {
    font-weight: 500;
    color: var(--faint);
}
.req {
    color: var(--brand-ink);
    margin-left: 1px;
}

.field-input {
    width: 100%;
    background: #fbfaff;
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    padding: 0.72rem 0.85rem;
    font-size: 0.92rem;
    color: var(--ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    outline: none;
}
.field-input::placeholder { color: var(--faint); }
.field-input:hover { border-color: var(--line-strong); }
.field-input:focus {
    border-color: var(--ink);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(20, 26, 60, 0.08);
}

select.field-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7191' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.65rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.4rem;
    cursor: pointer;
}

/* ---- Factor grid (Factor | Lower | Average | Higher) ---- */
.factor-head,
.factor-row {
    display: grid;
    grid-template-columns: minmax(230px, 1.4fr) minmax(0, 2.3fr);
    gap: 1rem;
    align-items: center;
}
.factor-head {
    padding: 0 0.25rem 0.8rem;
    border-bottom: 1px solid var(--line);
}
.factor-head .factor-col,
.factor-opts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}
.factor-head span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
}
.factor-head .factor-col span { text-align: center; }

.factor-row {
    padding: 1.05rem 0.25rem;
    border-bottom: 1px solid var(--line);
}
.factor-row:last-child { border-bottom: 0; }

.factor-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink);
}
.factor-desc {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
    line-height: 1.4;
}

.seg-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    cursor: pointer;
    transition: all 0.16s ease;
    user-select: none;
}
.seg-opt:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}
.seg-opt--good { color: var(--brand-ink); }
.seg-opt.is-selected {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(20, 26, 60, 0.5);
}
.seg-opt--good.is-selected {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(18, 166, 116, 0.6);
}
.seg-empty { visibility: hidden; }

/* ---- Dropzone ---- */
.dropzone {
    border: 1.5px dashed var(--line-strong);
    border-radius: 16px;
    padding: 1.6rem 1.25rem;
    text-align: center;
    background: #fbfaff;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.dropzone:hover { border-color: var(--ink-soft); background: #fff; }
.dropzone.is-drag { border-color: var(--brand); background: var(--brand-tint); }
.dz-files { color: var(--brand-ink); font-weight: 600; font-size: 0.8rem; }

/* ---- Advanced disclosure ---- */
.advanced { border: 1px solid var(--line); border-radius: var(--radius-card); background: rgba(255,255,255,0.6); }
.advanced > summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--ink);
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary .chev { transition: transform 0.2s ease; color: var(--muted); }
.advanced[open] > summary .chev { transform: rotate(180deg); }

/* ---- CTA ---- */
.cta-primary {
    width: 100%;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    padding: 1.05rem 1.5rem;
    border-radius: 14px;
    box-shadow: var(--shadow-cta);
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.cta-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(20, 26, 60, 0.62); }
.cta-primary:active:not(:disabled) { transform: translateY(0); }
.cta-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.link { color: var(--link); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---- Entrance motion ---- */
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.rise { opacity: 0; animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.14s; }
.rise-3 { animation-delay: 0.23s; }
.rise-4 { animation-delay: 0.32s; }
.rise-5 { animation-delay: 0.41s; }

@media (prefers-reduced-motion: reduce) {
    .rise { opacity: 1; animation: none; }
    .seg-opt:hover, .cta-primary:hover { transform: none; }
}

/* ---- Responsive: stack factor rows ---- */
@media (max-width: 760px) {
    .factor-head { display: none; }
    .factor-row {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }
    .seg-opt { min-height: 40px; font-size: 0.8rem; }
}

/* ============================================================
   Payment / checkout page (test)  — additive, uses tokens above.
   Vivid pay-blue (#3b46e0) matches the approved mock; --link is
   kept for text links so the two stay distinct.
   ============================================================ */
.pay-accent {
    height: 4px;
    background: linear-gradient(90deg, #7c5cff 0%, #4457d6 52%, #12a674 100%);
}
.pay-test-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #8a5a00;
    background: #fff4dc;
    border: 1px solid #f4d58a;
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
}

/* ---- Stepper ---- */
.pay-stepper {
    display: flex;
    align-items: center;
    max-width: 660px;
    margin: 0 auto;
}
.pay-step { display: flex; align-items: center; gap: 0.65rem; }
.pay-connector { flex: 1; height: 1px; background: var(--line); margin: 0 0.6rem; }
.pay-step-num {
    flex: none;
    width: 34px; height: 34px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.pay-step-num.is-done { background: var(--ink); color: #fff; }
.pay-step-num.is-active { background: #3b46e0; color: #fff; box-shadow: 0 6px 16px -8px rgba(59, 70, 224, 0.75); }
.pay-step-num.is-todo { background: #e9e7f5; color: var(--faint); }
.pay-step-title { font-weight: 700; font-size: 0.82rem; color: var(--ink); line-height: 1.1; }
.pay-step-sub { font-size: 0.72rem; color: var(--muted); }

/* ---- Main valuation card ---- */
.pay-icon-wrap {
    width: 78px; height: 78px;
    margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: radial-gradient(circle at 50% 38%, #e9ebff 0%, #f2f0fd 100%);
    color: #3b46e0;
}
.pay-price {
    font-family: '"Bricolage Grotesque"', 'Bricolage Grotesque', system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 4.1rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: #3b46e0;
}
.pay-check-item {
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: 0.9rem; font-weight: 600; color: var(--ink);
}
.pay-check-item svg { flex: none; width: 18px; height: 18px; color: #3b46e0; margin-top: 1px; }

.pay-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: #3b46e0; color: #fff;
    font-weight: 700; font-size: 1rem;
    padding: 1.05rem 1.5rem;
    border-radius: 14px;
    box-shadow: 0 12px 26px -12px rgba(59, 70, 224, 0.7);
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}
.pay-btn:hover:not(:disabled) { background: #2f3ad4; transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(59, 70, 224, 0.72); }
.pay-btn:active:not(:disabled) { transform: translateY(0); }
.pay-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.pay-upgrade-note {
    text-align: center;
    font-weight: 700;
    color: var(--ink);
    max-width: 30rem;
    margin: 1.25rem auto 0;
    font-size: 1.02rem;
}

/* ---- Manual valuation ---- */
.pay-manual-price {
    font-family: '"Bricolage Grotesque"', 'Bricolage Grotesque', system-ui, sans-serif;
    font-weight: 800; font-size: 2.4rem; color: #3b46e0; letter-spacing: -0.02em; line-height: 1;
}
.pay-outline-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    width: 100%;
    border: 1.5px solid #3b46e0; color: #3b46e0;
    font-weight: 700; font-size: 0.9rem;
    padding: 0.72rem 1rem; border-radius: 12px;
    background: #fff;
    transition: background 0.16s ease, transform 0.16s ease;
}
.pay-outline-btn:hover { background: #f3f4ff; transform: translateY(-1px); }

/* ---- Trust badges ---- */
.pay-badge-icon { color: var(--ink-soft); }

@media (max-width: 640px) {
    .pay-stepper { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .pay-connector { display: none; }
}


/* ---- Billing details on the payment page ---- */
.bill-kind {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    padding: 0.3rem;
    background: #f1effa;
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
}
.bill-kind input { position: absolute; opacity: 0; pointer-events: none; }
.bill-kind label {
    text-align: center;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0.55rem 0.5rem;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.bill-kind input:checked + label {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(20, 26, 60, 0.08), 0 4px 12px -6px rgba(20, 26, 60, 0.25);
}
.bill-kind input:focus-visible + label { box-shadow: 0 0 0 3px rgba(59, 70, 224, 0.35); }
.field-input.is-invalid,
.field-input.is-invalid:focus { border-color: var(--danger); background: #fff; }
.field-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(224, 84, 106, 0.14); }
.field-hint { font-size: 0.76rem; color: var(--muted); margin-top: 0.35rem; }
.field-error { font-size: 0.78rem; font-weight: 600; color: var(--danger); margin-top: 0.35rem; }
