/* === MakeMyLPA Stylesheet === */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1B5FAE;
    --primary-dark: #154A8A;
    --primary-light: #EBF2FA;
    --accent: #2BB5B8;
    --accent-dark: #239496;
    --accent-light: #E6F7F7;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

html {
    font-size: 17px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-900);
    line-height: 1.7;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100vw;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Skip navigation link (WCAG 2.4.1) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius) 0;
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
}
img { max-width: 100%; }

hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 1.5rem 0;
}

.text-center { text-align: center; }

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section { padding: 4rem 0; }
.section-alt { background: var(--gray-50); }

.section-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-dark) 100%);
    color: #fff;
}
.section-cta h2 { color: #fff; }
.section-cta p { color: rgba(255,255,255,0.85); }

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2rem;
}

.section-title::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

/* --- Grid --- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* --- Navbar --- */
.navbar {
    background: #fff;
    border-bottom: 2px solid var(--gray-100);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    color: var(--gray-900);
    text-decoration: none;
}

.nav-brand:hover { text-decoration: none; }

.nav-brand strong {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a {
    color: var(--gray-700);
    font-size: 1rem;
    text-decoration: none;
}

.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-links a.btn-primary { color: #fff; }
.nav-links a.btn-primary:hover { color: #fff; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    text-align: center;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

.btn-outline { background: transparent; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.88rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }
.btn-disabled { opacity: 0.6; cursor: not-allowed; }

.btn-danger { background: var(--danger); color: white; border: none; padding: 0.5rem 1.25rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.btn-danger:hover { background: #b91c1c; }

.section-cta .btn-primary { background: #fff; color: var(--primary); font-weight: 600; }
.section-cta .btn-primary:hover { background: var(--gray-100); color: var(--primary-dark); }

/* --- Cards --- */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover { box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: 0.75rem; }

/* --- Hero --- */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 40%, var(--accent-light) 100%);
}

.hero h1 {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    color: var(--gray-900);
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--gray-700);
    max-width: 640px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.hero-note {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* --- Features --- */
.feature {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.feature:hover { box-shadow: var(--shadow-md); }
.feature h3 { margin-bottom: 0.5rem; font-size: 1.05rem; color: var(--primary); }
.feature p { color: var(--gray-700); font-size: 1rem; }

/* --- Step Numbers --- */
.step-number {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* --- Forms --- */
.form { margin-top: 1rem; }
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 181, 184, 0.15);
}

/* Focus indicators for keyboard navigation (WCAG 2.4.7) */
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
select:focus-visible,
[type="radio"]:focus-visible + span,
[type="checkbox"]:focus-visible + span {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

.form-hint {
    display: block;
    color: var(--gray-700);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

/* --- Radio Cards --- */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.radio-group-3 {
    grid-template-columns: repeat(3, 1fr);
}

.radio-card {
    display: block;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}

.radio-card:hover { border-color: var(--primary); }

.radio-card-active,
.radio-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.radio-card input[type="radio"] { display: none; }

.radio-card-label {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.radio-card-desc {
    display: block;
    font-size: 0.88rem;
    color: var(--gray-500);
}

/* --- Alerts --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: 1rem;
}

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #bfdbfe; }

/* --- Dashboard --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge-draft { background: #fffbeb; color: #92400e; }
.badge-complete { background: #ecfdf5; color: var(--success); }
.badge-downloaded { background: var(--primary-light); color: var(--primary-dark); }
.badge-financial { background: var(--accent-light); color: var(--accent-dark); }
.badge-health { background: #fef3c7; color: #92400e; }

/* --- Tables --- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.table th, .table td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table tbody tr:hover { background: var(--gray-50); }

/* --- Wizard Progress Sidebar --- */
.wizard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}

.wizard-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.wizard-steps {
    list-style: none;
    padding: 0;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    font-size: 0.92rem;
    color: var(--gray-500);
    transition: all 0.2s;
}

.wizard-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--gray-100);
    color: var(--gray-500);
    border: 2px solid var(--gray-200);
}

.wizard-step.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.wizard-step.active .wizard-step-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.wizard-step.completed {
    color: var(--gray-700);
}

.wizard-step.completed .wizard-step-icon {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.wizard-step a {
    text-decoration: none;
    color: inherit;
}

.wizard-content {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.wizard-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.wizard-content .form-hint {
    margin-bottom: 1.5rem;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* --- Wizard Top Bar --- */
.wizard-topbar {
    background: var(--primary-light);
    border-bottom: 1px solid #bfdbfe;
    padding: 0.5rem 0;
    position: sticky;
    top: 54px;
    z-index: 99;
    font-size: 0.88rem;
    color: var(--primary-dark);
}

.wizard-topbar-icon {
    font-size: 1.1rem;
}

.wizard-topbar-saved {
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    background: #ecfdf5;
    border-radius: 999px;
}

/* --- Info Boxes --- */
.info-box {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
    color: var(--primary-dark);
}

.info-box strong {
    display: block;
    margin-bottom: 0.25rem;
}

.warning-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
    color: #92400e;
}

/* --- LPA Card (Dashboard) --- */
.lpa-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: white;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lpa-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.lpa-card-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.lpa-card-info p {
    font-size: 0.88rem;
    color: var(--gray-500);
    margin: 0;
}

.lpa-card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* --- Spinner --- */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Footer --- */
.footer {
    padding: 2rem 0;
    background: var(--gray-900);
    border-top: 3px solid var(--accent);
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-300);
}

.footer a { color: var(--accent); }
.footer a:hover { color: #fff; }

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-links a { font-size: 0.88rem; }

.footer-company {
    font-size: 0.82rem;
    color: var(--gray-500);
    line-height: 1.6;
}

.footer-company p { margin-bottom: 0.25rem; }
.footer-company a { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero-cta { flex-direction: column; align-items: center; }

    .nav-container { flex-wrap: wrap; }
    .nav-brand strong { font-size: 1.25rem; }
    .nav-links {
        gap: 0.5rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        padding-top: 0.5rem;
        border-top: 1px solid var(--gray-100);
        margin-top: 0.5rem;
    }

    .dashboard-header { flex-direction: column; gap: 1rem; }
    .grid-3 { grid-template-columns: 1fr; }
    .radio-group { grid-template-columns: 1fr; }
    .radio-group-3 { grid-template-columns: 1fr; }

    .wizard-layout {
        grid-template-columns: 1fr;
    }

    .wizard-sidebar {
        position: static;
    }

    .wizard-steps {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .wizard-step {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }

    .footer-links { flex-direction: column; gap: 0.5rem; }

    .lpa-card { flex-direction: column; gap: 1rem; text-align: center; }

    .form-row { flex-direction: column; }
    .form-row .form-group { max-width: none !important; }

    .section { padding: 2rem 0; }
    .container { padding: 0 1rem; }

    /* Tables scroll horizontally within their card, not the whole page */
    .review-table td { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
    .review-table td:first-child { width: 40%; }

    .order-table th, .order-table td { padding: 0.5rem; font-size: 0.82rem; }

    .info-box, .warning-box { padding: 0.75rem; font-size: 0.92rem; }

    .service-price { font-size: 1.3rem; }
    .donation-options { flex-direction: column; }

    .btn-lg { padding: 0.7rem 1.5rem; font-size: 1rem; }
    .step-number { width: 36px; height: 36px; font-size: 1rem; }
}

/* --- Form Row (side by side fields) --- */
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

/* --- Radio Options (vertical list) --- */
.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.5;
}

.radio-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-option input[type="radio"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

/* --- Person Cards (attorney/replacement/notify list) --- */
.person-list {
    margin: 1rem 0;
}

.person-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--gray-50);
}

.person-card-info strong {
    display: block;
}

.person-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* --- Review Sections --- */
.review-section {
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.review-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.review-section-header h3 {
    margin: 0;
    font-size: 1rem;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
}

.review-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.92rem;
    vertical-align: top;
}

.review-table td:first-child {
    width: 35%;
    color: var(--gray-500);
    font-weight: 500;
}

.review-table tr:last-child td {
    border-bottom: none;
}

/* ── Service & Donation Cards ──────────────────────────────── */

.service-card {
    display: flex;
    flex-direction: column;
}

.service-card form:last-child,
.service-card .badge:last-child {
    margin-top: auto;
}

.service-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.donation-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.donation-custom {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

/* ── Admin Dashboard ───────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.order-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
}

.order-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.order-table tr:hover {
    background: var(--gray-50);
}

/* ── Dashboard Upsell Strip ──────────────────────────────── */
.lpa-upsell-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    margin-top: -0.5rem;
    margin-bottom: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    flex-wrap: wrap;
}

.lpa-upsell-strip .btn-outline {
    font-size: 0.82rem;
    padding: 0.25rem 0.6rem;
}

/* ── Donation Card ───────────────────────────────────────── */
.donation-card {
    display: flex;
    flex-direction: column;
}

.donation-card form:last-child,
.donation-card .btn:last-child {
    margin-top: auto;
}

.badge-paid { background: #ecfdf5; color: var(--success); }
.badge-pending { background: #fffbeb; color: #92400e; }
.badge-cancelled { background: #fef2f2; color: #991b1b; }
.badge-in_progress { background: var(--primary-light); color: var(--primary-dark); }
.badge-donation { background: var(--accent-light); color: var(--accent-dark); }
.badge-professional_review { background: #ede9fe; color: #5b21b6; }
.badge-professional_review_financial { background: #ede9fe; color: #5b21b6; }
.badge-professional_review_health { background: #ede9fe; color: #5b21b6; }
.badge-professional_review_both { background: #ede9fe; color: #5b21b6; }
.badge-print_post { background: #fef3c7; color: #92400e; }
