/* =====================================================================
   Protest Wizard — guided step-by-step popup that replaces the old chain
   of separate modals (paywall → service → type → create → payment).
   Self-contained; paired with protest-wizard.js.
   ===================================================================== */

.pw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100040;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.pw-overlay.pw-show { opacity: 1; }

.pw-modal {
    background: #fff;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px);
    transition: transform 0.25s ease;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}
.pw-overlay.pw-show .pw-modal { transform: translateY(0); }

/* ── Header + progress stepper ──────────────────────────────────────── */
.pw-header {
    padding: 1.25rem 1.5rem 0.5rem;
    border-bottom: 1px solid #eef2f7;
}
.pw-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.pw-title { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0; }
.pw-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}
.pw-close:hover { color: #475569; }

.pw-steps {
    display: flex;
    align-items: center;
    gap: 0;
    padding-bottom: 1rem;
}
.pw-step {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.pw-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.pw-step-line {
    height: 2px;
    background: #e2e8f0;
    flex: 1;
    margin: 0 4px;
    transition: background 0.2s;
}
.pw-step:last-child .pw-step-line { display: none; }
.pw-step.pw-current .pw-step-dot { background: #7c3aed; color: #fff; }
.pw-step.pw-done .pw-step-dot { background: #10b981; color: #fff; }
.pw-step.pw-done .pw-step-line { background: #10b981; }

/* ── Body ───────────────────────────────────────────────────────────── */
.pw-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}
.pw-step-title { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 0 0 0.35rem; }
.pw-step-sub { font-size: 0.92rem; color: #64748b; margin: 0 0 1.25rem; line-height: 1.5; }

/* Property summary card */
.pw-prop-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    background: #f8fafc;
}
.pw-prop-addr { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin-bottom: 0.15rem; }
.pw-prop-acct { font-size: 0.8rem; color: #94a3b8; margin-bottom: 1rem; }
.pw-prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.pw-prop-stat { background: #fff; border: 1px solid #eef2f7; border-radius: 8px; padding: 0.65rem 0.8rem; }
.pw-prop-stat .pw-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
.pw-prop-stat .pw-value { font-size: 1.05rem; font-weight: 700; color: #0f172a; }
.pw-prop-stat .pw-value.pw-up { color: #b91c1c; }

/* Estimated savings hero */
.pw-savings-hero {
    text-align: center;
    background: linear-gradient(160deg, #9333ea, #7c3aed);
    color: #fff;
    border-radius: 14px;
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.25rem;
}
.pw-savings-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.8; }
.pw-savings-amount { font-size: 2.75rem; font-weight: 800; line-height: 1.1; margin: 0.35rem 0; }
.pw-savings-note { font-size: 0.82rem; opacity: 0.85; }

.pw-strategy {
    border: 1px solid #e9d5ff;
    background: #faf5ff;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}
.pw-strategy i { color: #7c3aed; font-size: 1.2rem; margin-top: 2px; }
.pw-strategy-title { font-weight: 700; color: #7c3aed; margin-bottom: 0.2rem; font-size: 0.95rem; }
.pw-strategy-text { font-size: 0.86rem; color: #334155; line-height: 1.5; }

/* Condition step */
.pw-repair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.25rem; }
.pw-repair {
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 0.6rem 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: #334155;
    transition: border-color 0.15s, background 0.15s;
}
.pw-repair:hover { border-color: #d8b4fe; }
.pw-repair.pw-sel { border-color: #7c3aed; background: #faf5ff; font-weight: 600; }
.pw-repair input { accent-color: #7c3aed; }
.pw-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.85rem; }
.pw-field label { display: block; font-size: 0.75rem; color: #64748b; margin-bottom: 0.25rem; font-weight: 600; }
.pw-field input, .pw-field textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    font-family: inherit;
}
.pw-field textarea { resize: vertical; min-height: 64px; }
.pw-repair-total {
    font-size: 0.85rem;
    color: #047857;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Payment */
.pw-pay-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
.pw-pay-summary .pw-fee { font-size: 1.4rem; font-weight: 800; color: #0f172a; }
#pw-payment-element { margin: 0.5rem 0 0.75rem; min-height: 40px; }
.pw-pay-error { color: #b91c1c; font-size: 0.85rem; min-height: 1.1em; }

/* Generating / loading */
.pw-loading { text-align: center; padding: 2.5rem 1rem; }
.pw-spinner {
    width: 46px; height: 46px;
    border: 4px solid #e2e8f0;
    border-top-color: #7c3aed;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    animation: pw-spin 0.9s linear infinite;
}
@keyframes pw-spin { to { transform: rotate(360deg); } }
.pw-loading-text { font-size: 1rem; font-weight: 600; color: #334155; }
.pw-loading-sub { font-size: 0.85rem; color: #94a3b8; margin-top: 0.35rem; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.pw-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eef2f7;
    background: #fff;
}
.pw-btn {
    border: none;
    border-radius: 9px;
    padding: 0.7rem 1.4rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
}
.pw-btn-primary { background: linear-gradient(135deg, #9333ea, #7c3aed); color: #fff; }
.pw-btn-primary:hover { background: linear-gradient(135deg, #7c3aed, #6b21a8); }
.pw-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.pw-btn-ghost { background: none; color: #64748b; }
.pw-btn-ghost:hover { color: #1e293b; }
.pw-btn-link { background: none; color: #7c3aed; text-decoration: underline; padding: 0.7rem 0.5rem; }

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .pw-overlay { padding: 0; align-items: stretch; }
    .pw-modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
    .pw-prop-grid, .pw-repair-grid, .pw-field-row { grid-template-columns: 1fr; }
    .pw-savings-amount { font-size: 2.25rem; }
    .pw-step-title { font-size: 1.2rem; }
    .pw-footer { padding: 0.85rem 1rem; }
    .pw-btn { padding: 0.7rem 1.1rem; }
    /* Hide numeric step dots' connecting noise on very small screens but keep dots */
    .pw-step-line { margin: 0 2px; }
}
