/* ─── Jago Grahak Jago — Legal Notice Generator ─────────────────── */
/* Color palette from the GOI Jago Grahak Jago branding */
:root {
    --red: #E11D48;
    --red-dark: #BE123C;
    --orange: #EA580C;
    --orange-dark: #C2410C;
    --yellow: #F59E0B;
    --yellow-light: #FEF3C7;
    --green: #10B981;
    --green-light: #D1FAE5;
    --blue: #0F172A; /* Deep slate for lawly */
    --blue-light: #334155;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --white: #FFFFFF;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
    --primary: #2563EB; /* Bright blue for prominent buttons */
    --primary-hover: #1D4ED8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

.api-config {
    background: #FEF3C7;
    border-bottom: 1px solid #FDE68A;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.api-config label {
    font-size: 0.85rem;
    color: var(--gray-700);
    font-weight: 600;
}

.api-config input {
    min-width: 260px;
    max-width: 460px;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: #fff;
}

.hidden { display: none !important; }

/* ─── Progress Bar ─────────────────────────────────────────────── */
.progress-bar {
    position: sticky; top: 0; z-index: 100;
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    padding: 12px 20px;
}
.progress-steps {
    display: flex; justify-content: center; gap: 8px; max-width: 700px; margin: 0 auto;
}
.p-step {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    opacity: .35; transition: opacity .3s;
}
.p-step.active, .p-step.done { opacity: 1; }
.p-step span {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: var(--gray-200); color: var(--gray-600);
}
.p-step.active span { background: var(--red); color: var(--white); }
.p-step.done span { background: var(--green); color: var(--white); }
.p-step small { font-size: 10px; color: var(--gray-400); font-weight: 500; }
.p-step.active small { color: var(--red); }

/* ─── Step sections ────────────────────────────────────────────── */
.step { display: none; animation: fadeIn .35s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ─── Hero (Step 0) ────────────────────────────────────────────── */
.hero {
    text-align: center; padding: 60px 24px 80px;
    background: linear-gradient(170deg, var(--yellow-light) 0%, var(--white) 60%);
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.logo-container { margin-bottom: 28px; }
.sun-logo { position: relative; }
.logo-img { width: 180px; height: auto; }
.fallback-logo {
    font-weight: 800;
    color: var(--primary);

    width: 160px; height: 160px; border-radius: 50%;
    background: var(--yellow); display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    box-shadow: 0 0 0 8px rgba(245,158,11,.3), 0 0 0 16px rgba(245,158,11,.15);
}
.sun-text { font-weight: 900; line-height: 1.1; }
.sun-text.top, .sun-text.bot { color: var(--red); font-size: 28px; }
.sun-text.mid {
    font-size: 28px;
    letter-spacing: 2px;
 color: var(--orange-dark); font-size: 22px; }

.hero h1 { font-size: 2.5rem; font-weight: 900; color: var(--gray-900); margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; color: var(--gray-600); max-width: 520px; margin-bottom: 32px; }
.hero-stats {
    display: flex; gap: 40px; margin-bottom: 36px;
}
.stat { text-align: center; }
.stat strong { display: block; font-size: 1.5rem; color: var(--red); }
.stat span { font-size: .8rem; color: var(--gray-400); }
.hero-note { font-size: .8rem; color: var(--gray-400); margin-top: 16px; }

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
    max-width: 720px; margin: 32px auto; padding: 36px 32px;
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card h2 { font-size: 1.5rem; margin-bottom: 4px; color: var(--gray-900); }
.card-sub { color: var(--gray-400); margin-bottom: 24px; font-size: .95rem; }

/* ─── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; color: var(--gray-700); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200);
    border-radius: 8px; font-size: .95rem; font-family: inherit;
    transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.req { color: var(--red); }
.hint { display: block; margin-top: 4px; font-size: .8rem; color: var(--gray-400); }

/* Dynamic lists (timeline, evidence) */
.dynamic-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.dynamic-item {
    display: flex; align-items: center; gap: 8px;
    background: var(--gray-50); padding: 8px 12px; border-radius: 8px;
    font-size: .9rem;
}
.dynamic-item span { flex: 1; }
.dynamic-item button {
    background: none; border: none; color: var(--red); cursor: pointer;
    font-size: 1.1rem; padding: 2px 6px; border-radius: 4px;
}
.dynamic-item button:hover { background: rgba(220,38,38,.1); }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: .9rem; }

.voice-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.voice-lang {
    min-width: 210px;
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    font-size: .85rem;
}

.voice-capture-panel {
    margin-top: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 12px;
}

.voice-capture-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mic-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid var(--red);
    background: var(--white);
    color: var(--red);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .2s ease;
}

.mic-icon-btn:hover {
    background: var(--red);
    color: var(--white);
}

.mic-icon-btn.recording {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 0 0 5px rgba(220, 38, 38, .18);
}

.smart-intake {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-50);
    margin-bottom: 14px;
}

#smart-intake-status {
    flex: 1 1 280px;
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; border-radius: 8px; font-size: .95rem;
    font-weight: 600; cursor: pointer; transition: all .2s;
    border: 2px solid transparent;
}
.btn-primary { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--red); color: var(--white); }
.btn-ghost { background: transparent; color: var(--gray-600); border-color: var(--gray-200); }
.btn-ghost:hover { border-color: var(--gray-400); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 36px; font-size: 1.1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }

.final-details-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-50);
}

.final-details-panel h4 {
    margin-bottom: 6px;
}

.confirm-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 14px;
    font-size: .92rem;
}

/* ─── Loading card ─────────────────────────────────────────────── */
.loading-card { text-align: center; padding: 60px 32px; }
.spinner {
    width: 48px; height: 48px; border: 4px solid var(--gray-200);
    border-top-color: var(--red); border-radius: 50%;
    animation: spin .8s linear infinite; margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-stages { margin: 24px 0; text-align: left; max-width: 360px; margin-left: auto; margin-right: auto; }
.stage {
    padding: 8px 0; font-size: .9rem; color: var(--gray-300);
    transition: color .4s;
}
.stage.active { color: var(--gray-800); font-weight: 600; }
.stage.done { color: var(--green); }
.loading-note { font-size: .85rem; color: var(--gray-400); margin-top: 16px; }

/* ─── Found data grid (step 5) ─────────────────────────────────── */
.found-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px;
}
.found-card {
    background: var(--gray-50); border-radius: 8px; padding: 14px 16px;
    border-left: 3px solid var(--orange);
}
.found-card.success { border-left-color: var(--green); }
.found-card.warn { border-left-color: var(--red); }
.found-card h4 { font-size: .8rem; text-transform: uppercase; color: var(--gray-400); margin-bottom: 4px; letter-spacing: .5px; }
.found-card p { font-size: .95rem; font-weight: 600; color: var(--gray-800); word-break: break-all; }
.found-card .not-found { color: var(--gray-400); font-weight: 400; font-style: italic; }

/* Case strength */
.case-strength-box {
    padding: 16px 20px; border-radius: 8px; margin-bottom: 24px;
}
.case-strength-box.strong { background: var(--green-light); border-left: 4px solid var(--green); }
.case-strength-box.moderate { background: #FFF7ED; border-left: 4px solid var(--orange); }
.case-strength-box.weak { background: #FEF2F2; border-left: 4px solid var(--red); }
.case-strength-box h3 { font-size: 1rem; margin-bottom: 4px; }
.case-strength-box p { font-size: .9rem; color: var(--gray-600); }

/* Questions section */
.questions-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--gray-200); }
.questions-section h3 { margin-bottom: 4px; }
.question-card {
    background: var(--yellow-light); border-radius: 8px; padding: 16px;
    margin-bottom: 12px;
}
.question-card .q-label {
    display: inline-block; font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px;
    border-radius: 4px; margin-bottom: 6px;
}
.question-card .q-label.critical { background: var(--red); color: var(--white); }
.question-card .q-label.important { background: var(--orange); color: var(--white); }
.question-card .q-text { font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.question-card .q-why { font-size: .8rem; color: var(--gray-400); margin-bottom: 8px; }
.question-card textarea {
    width: 100%; padding: 8px 12px; border: 1px solid var(--gray-200);
    border-radius: 6px; font-size: .9rem; font-family: inherit; resize: vertical;
}

/* ─── Tier cards (step 6) ──────────────────────────────────────── */
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.tier-card {
    border: 2px solid var(--gray-200); border-radius: var(--radius);
    padding: 28px 24px; text-align: center; cursor: pointer;
    transition: all .2s; position: relative;
}
.tier-card:hover { border-color: var(--red); box-shadow: var(--shadow-lg); }
.tier-card.selected { border-color: var(--red); background: #FEF2F2; }
.tier-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--orange); color: var(--white); font-size: .7rem;
    font-weight: 700; padding: 3px 12px; border-radius: 20px;
    letter-spacing: .5px;
}
.tier-price { font-size: 2.2rem; font-weight: 900; color: var(--red); }
.tier-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 16px; }
.tier-features { list-style: none; text-align: left; margin-bottom: 20px; }
.tier-features li { padding: 4px 0; font-size: .88rem; color: var(--gray-600); }

.gen-progress-wrap {
    width: 100%;
    max-width: 560px;
    margin: 14px auto 12px;
}

.gen-progress-track {
    width: 100%;
    height: 12px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.gen-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--orange), var(--red));
    border-radius: 999px;
    transition: width 0.35s ease;
}

.gen-progress-meta {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* ─── Success card (step 8) ────────────────────────────────────── */
.success-card { text-align: center; }
.success-icon { font-size: 3rem; margin-bottom: 8px; }
.info-box {
    text-align: left; background: var(--gray-50); border-radius: 8px;
    padding: 20px 24px; margin: 20px 0;
}
.info-box h3 { margin-bottom: 8px; }
.info-box ol { padding-left: 20px; }
.info-box li { margin-bottom: 6px; font-size: .9rem; }

/* Lawyer status timeline */
.status-timeline { display: flex; flex-direction: column; gap: 0; margin: 16px 0; }
.status-step {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; font-size: .9rem; color: var(--gray-400);
    position: relative;
}
.status-step .dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--gray-300); flex-shrink: 0;
}
.status-step.done .dot { background: var(--green); border-color: var(--green); }
.status-step.active .dot { background: var(--orange); border-color: var(--orange); animation: pulse 1.5s infinite; }
.status-step.done { color: var(--green); font-weight: 600; }
.status-step.active { color: var(--orange-dark); font-weight: 600; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,.4); }
    50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}
.lawyer-note { font-size: .9rem; color: var(--gray-600); margin-top: 12px; }

/* Notice preview */
.notice-preview { margin: 20px 0; text-align: left; }
.notice-preview summary {
    cursor: pointer; font-weight: 600; padding: 10px; color: var(--gray-600);
}
.notice-preview pre {
    background: var(--gray-50); padding: 20px; border-radius: 8px;
    font-size: .8rem; line-height: 1.5; overflow-x: auto;
    white-space: pre-wrap; word-wrap: break-word;
    max-height: 500px; overflow-y: auto;
    font-family: 'Courier New', monospace;
}

/* ─── Error overlay ────────────────────────────────────────────── */
.error-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center; z-index: 999;
}
.error-box {
    background: var(--white); border-radius: var(--radius); padding: 32px;
    max-width: 440px; width: 90%; text-align: center;
}
.error-box h3 { margin-bottom: 12px; }
.error-box p { color: var(--gray-600); margin-bottom: 20px; font-size: .9rem; }

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .tier-grid { grid-template-columns: 1fr; }
    .found-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.8rem; }
    .hero-stats { gap: 20px; }
    .card { margin: 16px; padding: 24px 20px; }
    .progress-steps { gap: 4px; }
    .p-step small { display: none; }
    .trust-badges { flex-direction: column; gap: 6px; }
    .value-preview-grid { grid-template-columns: 1fr; }
}

/* ─── Hero trust badges ────────────────────────────────────────── */
.trust-badges {
    display: flex; gap: 16px; margin-top: 20px; flex-wrap: wrap; justify-content: center;
}
.trust-badge {
    font-size: .8rem; color: var(--gray-600); background: var(--white);
    border: 1px solid var(--gray-200); border-radius: 20px;
    padding: 6px 14px; font-weight: 500;
}

/* ─── Hero testimonial ─────────────────────────────────────────── */
.hero-testimonial {
    margin-top: 28px; max-width: 440px;
    background: var(--white); border-radius: var(--radius);
    padding: 20px 24px; box-shadow: var(--shadow);
    border-left: 3px solid var(--green);
}
.testimonial-text {
    font-size: .95rem; font-style: italic; color: var(--gray-700);
    line-height: 1.5; margin-bottom: 6px;
}
.testimonial-author {
    font-size: .8rem; font-weight: 600; color: var(--gray-400);
}

/* ─── Loading tips ─────────────────────────────────────────────── */
.loading-tip {
    max-width: 420px; margin: 16px auto 0;
    font-size: .85rem; color: var(--gray-500); text-align: center;
    padding: 12px 16px; background: var(--yellow-light);
    border-radius: 8px; border-left: 3px solid var(--orange);
    opacity: 0; transition: opacity .3s ease;
    min-height: 48px;
}
.loading-tip.visible { opacity: 1; }

/* ─── Strength nudge bar ───────────────────────────────────────── */
.strength-nudge {
    margin-bottom: 20px; padding: 16px 20px;
    background: var(--gray-50); border-radius: 8px;
}
.strength-nudge-bar {
    width: 100%; height: 10px; background: var(--gray-200);
    border-radius: 999px; overflow: hidden;
}
.strength-nudge-fill {
    height: 100%; border-radius: 999px; transition: width .4s ease;
}
.strength-nudge-fill.strong { background: var(--green); }
.strength-nudge-fill.moderate { background: var(--orange); }
.strength-nudge-fill.weak { background: var(--red); }
.strength-nudge-text {
    margin-top: 6px; font-size: .85rem; color: var(--gray-600); font-weight: 500;
}

/* ─── Value preview grid ───────────────────────────────────────── */
.value-preview {
    margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--gray-200);
}
.value-preview h3 { margin-bottom: 14px; }
.value-preview-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.vp-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 12px; background: var(--gray-50); border-radius: 8px;
}
.vp-icon { font-size: 1.3rem; flex-shrink: 0; }
.vp-item strong { font-size: .88rem; color: var(--gray-800); }
.vp-item small { font-size: .78rem; color: var(--gray-400); }

/* ─── Tier page improvements ───────────────────────────────────── */
.tier-social-proof {
    text-align: center; margin-bottom: 20px;
    font-size: .9rem; color: var(--orange-dark); font-weight: 600;
}
.tier-desc {
    font-size: .85rem; color: var(--gray-400); margin-bottom: 14px;
}
.tier-feature-dim {
    color: var(--gray-300) !important; text-decoration: line-through;
}
.tier-nudge {
    margin-top: 10px; font-size: .8rem; color: var(--green); font-weight: 600;
}
.tier-card.recommended {
    border-color: var(--orange); box-shadow: 0 0 0 2px rgba(245,158,11,.15);
}
.tier-urgency {
    margin-top: 20px; padding: 14px 18px;
    background: #FFF7ED; border-radius: 8px; border-left: 3px solid var(--orange);
    font-size: .9rem; color: var(--gray-700);
}
.tier-urgency p { margin: 0; }
.tier-comparison {
    margin-top: 16px; padding: 14px 18px;
    background: var(--gray-50); border-radius: 8px;
    font-size: .88rem; color: var(--gray-600);
}
.tier-comparison h4 { font-size: .9rem; margin-bottom: 6px; color: var(--gray-700); }

/* ─── Upsell box (step 8 self-send) ────────────────────────────── */
.upsell-box {
    margin-top: 20px; padding: 18px 20px;
    background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
    border: 2px solid var(--orange); border-radius: var(--radius);
}
.upsell-box h4 { color: var(--orange-dark); margin-bottom: 6px; }
.upsell-box p { font-size: .9rem; color: var(--gray-700); margin-bottom: 12px; }
.upsell-box .btn { width: 100%; justify-content: center; }
