/* ==========================================================
   LEGAL HUB — COMPLETE RESPONSIVE SYSTEM
   Mobile-first approach | 320px → 1440px+
   ========================================================== */

/* ─── Base: Touch Targets & Typography ─────────────────── */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}
body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body.no-scroll {
    overflow: hidden;
}
/* Add bottom padding so floating WhatsApp button never covers content */
body {
    padding-bottom: 0;
}
@media (max-width: 1024px) {
    footer {
        padding-bottom: 4.5rem !important;
    }
}
* {
    -webkit-tap-highlight-color: transparent;
}
button, a, input, select, textarea {
    min-height: 44px;
}
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* ─── Mobile Menu Slide-In ──────────────────────────────── */
#mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;          /* START: completely off screen */
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: #05050A;
    border-left: 1px solid rgba(198,164,63,0.15);
    z-index: 1001;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);  /* animate right, not transform */
    padding: 90px 28px 28px;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column;
}
/* Note: JS sets style.right='0' to open, style.right='-100%' to close */

#mobile-menu a {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #8A8A9E;
    text-transform: uppercase;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.2s ease;
    min-height: 52px;
}
#mobile-menu a:hover { color: #C6A43F; }
#mobile-menu a:last-child { border-bottom: none; }

#mobile-menu-close {
    position: absolute;
    top: 24px;
    right: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s ease;
    min-height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#mobile-menu-close:hover {
    background: rgba(198,164,63,0.1);
    border-color: rgba(198,164,63,0.3);
}

/* Overlay */
#menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(4px);
}
/* Note: JS sets opacity/pointerEvents directly */

/* ─── Hamburger Button ──────────────────────────────────── */
#mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}
#mobile-menu-btn:hover {
    border-color: rgba(198,164,63,0.4);
}
#mobile-menu-btn svg {
    display: block;
}

/* ─── 320px–640px: Mobile ───────────────────────────────── */
@media (max-width: 640px) {
    html { font-size: 14px; }

    /* Navbar */
    #navbar {
        padding: 1rem 1.25rem !important;
    }
    #desktop-nav,
    nav .hidden.lg\\:flex {
        display: none !important;
    }
    #mobile-menu-btn {
        display: flex !important;
    }

    /* Hero */
    h1.hero-title {
        font-size: 2.6rem !important;
        line-height: 1.05 !important;
        letter-spacing: -0.02em !important;
    }
    .hero-sub {
        font-size: 1rem !important;
    }
    section.relative.min-h-screen {
        padding-top: 90px !important;
        padding-bottom: 3rem !important;
        min-height: auto !important;
    }
    /* Stack hero buttons */
    .flex.flex-col-sm,
    div.flex.flex-col-sm {
        flex-direction: column !important;
        width: 100%;
    }
    .flex.flex-col-sm .btn,
    .flex.flex-col.sm\\:flex-row .btn {
        width: 100% !important;
        margin-bottom: 0.75rem !important;
        justify-content: center;
    }
    /* Buttons: full width on mobile */
    .btn {
        width: 100%;
        padding: 1rem 1.5rem !important;
        font-size: 0.8rem !important;
        justify-content: center;
        min-height: 52px;
    }
    /* Hide 3D canvas on mobile */
    #three-canvas-container {
        display: none !important;
    }

    /* Section padding */
    .section-padding {
        padding: 4rem 0 !important;
    }

    /* Stats: 2x2 grid */
    .grid.grid-cols-2.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    /* Feature cards: single column */
    .grid.grid-cols-3,
    .grid.grid-cols-4 {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .feature-card {
        padding: 1.75rem !important;
        transform: none !important;
    }
    .feature-card:hover {
        transform: none !important;
    }

    /* Features 2-col mini grid: single col */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .glass-panel {
        padding: 1.5rem !important;
    }

    /* Pricing: single column, no scale */
    .grid.grid-cols-3.gap-8.items-center > div {
        transform: none !important;
        scale: 1 !important;
    }

    /* Testimonials: restrict width */
    #testimonial-track .inline-block {
        width: 85vw !important;
        min-width: 280px !important;
    }

    /* Footer: single column */
    footer .grid.grid-cols-1.md\\:grid-cols-12 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    footer .md\\:col-span-2,
    footer .md\\:col-span-5 {
        grid-column: span 1 !important;
    }
    footer form.flex {
        flex-direction: column !important;
    }
    footer form.flex input {
        border-radius: 6px !important;
        border-right: 1px solid !important;
        margin-bottom: 0.5rem;
    }
    footer form.flex button {
        border-radius: 6px !important;
        width: 100%;
    }
    footer .border-t.border-gray-900 {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center;
    }
    footer .border-t p:last-child {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem !important;
    }

    /* Section headings */
    h2.section-title,
    h2.section-title.text-4xl,
    h2.section-title.text-5xl {
        font-size: 1.8rem !important;
        line-height: 1.15 !important;
    }
    .text-5xl.md\\:text-6xl.lg\\:text-7xl {
        font-size: 2.2rem !important;
    }

    /* LG grid 2-col → 1-col */
    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    .lg\\:grid-cols-2 > div.pr-10 {
        padding-right: 0 !important;
    }

    /* Padding in px-6 elements */
    .max-w-7xl.mx-auto.px-6,
    .max-w-4xl.mx-auto.px-6 {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    /* CTA section */
    .py-32 { padding-top: 5rem !important; padding-bottom: 5rem !important; }

    /* WhatsApp button */
    .fixed.bottom-6.right-6 {
        bottom: 1rem !important;
        right: 1rem !important;
        width: 52px !important;
        height: 52px !important;
    }
    .fixed.bottom-6.right-6 svg {
        width: 28px !important;
        height: 28px !important;
    }

    /* Particles canvas: reduce opacity */
    #particles-bg { opacity: 0.2 !important; }
}

/* ─── 641px–768px: Large Mobile ─────────────────────────── */
@media (min-width: 641px) and (max-width: 768px) {
    html { font-size: 15px; }

    #mobile-menu-btn { display: flex !important; }
    #desktop-nav { display: none !important; }
    nav .hidden.lg\\:flex { display: none !important; }

    h1.hero-title { font-size: 3.5rem !important; }

    .grid.grid-cols-3 {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }
    .grid.grid-cols-4 {
        grid-template-columns: 1fr 1fr !important;
    }
    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    #three-canvas-container {
        opacity: 0.25 !important;
        height: 40vh !important;
    }

    .section-padding { padding: 5rem 0 !important; }
}

/* ─── 769px–1024px: Tablet ──────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    html { font-size: 15px; }

    #mobile-menu-btn { display: flex !important; }
    #desktop-nav { display: none !important; }
    nav .hidden.lg\\:flex { display: none !important; }

    h1.hero-title { font-size: 4rem !important; }
    h2.section-title { font-size: 2.5rem !important; }

    .grid.grid-cols-3 {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }
    .grid.grid-cols-3.items-center > div:last-child {
        grid-column: 1 / -1;
        max-width: 480px;
        margin: 0 auto;
    }

    #three-canvas-container {
        opacity: 0.35 !important;
        width: 45% !important;
    }

    .section-padding { padding: 6rem 0 !important; }
    .feature-card { padding: 2rem !important; }
}

/* ─── 1025px–1280px: Desktop ────────────────────────────── */
@media (min-width: 1025px) {
    #mobile-menu-btn { display: none !important; }
    #mobile-menu { display: none !important; }
    #menu-overlay { display: none !important; }

    h1.hero-title { font-size: 5.5rem !important; }
}

/* ─── 1281px–1440px: Large Desktop ─────────────────────── */
@media (min-width: 1281px) {
    h1.hero-title { font-size: 7.5rem !important; }
}

/* ─── 1441px+: XL Desktop ───────────────────────────────── */
@media (min-width: 1441px) {
    html { font-size: 18px; }
    .max-w-7xl { max-width: 1400px; }
    h1.hero-title { font-size: 8.5rem !important; }
    .section-padding { padding: 10rem 0 !important; }
}

/* ─── Register-Firm Multi-Step Responsive ───────────────── */
@media (max-width: 640px) {
    /* Steps indicator */
    .reg-steps {
        flex-direction: row !important;
        justify-content: center;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    .reg-steps .step-label {
        font-size: 0.6rem !important;
    }
    /* Step connector lines */
    .reg-steps .step-line {
        flex: 1;
        min-width: 20px;
        max-width: 60px;
    }
    /* Form grid: single column */
    .reg-form-grid {
        grid-template-columns: 1fr !important;
    }
    /* Plan cards: vertical stack */
    .plan-grid {
        grid-template-columns: 1fr !important;
    }
    /* Payment section: stacked */
    .payment-grid {
        grid-template-columns: 1fr !important;
    }
    /* Submit button full width */
    .reg-submit {
        width: 100% !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .plan-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .payment-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ─── Check Status Page ─────────────────────────────────── */
.status-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}
@media (max-width: 640px) {
    .status-container {
        padding: 1rem 1.25rem;
    }
}

/* ─── Super Admin Payment Requests — Card View on Mobile ── */
@media (max-width: 768px) {
    /* Table → Cards */
    .sa-requests-table table,
    .sa-requests-table thead,
    .sa-requests-table tbody,
    .sa-requests-table tr,
    .sa-requests-table th,
    .sa-requests-table td {
        display: block !important;
    }
    .sa-requests-table thead { display: none !important; }
    .sa-requests-table tr {
        border: 1px solid #334155;
        border-radius: 12px;
        margin-bottom: 1rem;
        padding: 1rem;
        background: #1E293B;
    }
    .sa-requests-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        padding: 6px 0;
        border: none !important;
        font-size: 0.8rem;
    }
    .sa-requests-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748B;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        width: 40%;
        flex-shrink: 0;
    }
    /* Stat cards: 2-col */
    .sa-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    /* Filter tabs: wrap */
    .sa-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .sa-tabs a {
        font-size: 0.7rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    /* Action buttons: stack */
    .sa-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .sa-actions button {
        width: 100% !important;
        font-size: 0.75rem !important;
    }
    /* Card info grid: single column */
    .sa-card-grid {
        grid-template-columns: 1fr !important;
    }
    .sa-card-border {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px solid #334155;
        padding-top: 1rem;
        margin-top: 1rem;
    }
    /* Receipt button full width */
    .sa-receipt-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ─── About / Careers / Privacy / Contact — Responsive ──── */
@media (max-width: 640px) {
    .info-hero-title {
        font-size: 2rem !important;
    }
    .info-grid-3 {
        grid-template-columns: 1fr !important;
    }
    .info-grid-2 {
        grid-template-columns: 1fr !important;
    }
    .contact-form-grid {
        grid-template-columns: 1fr !important;
    }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .info-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .info-grid-2 {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ─── Utility: No Horizontal Scroll ────────────────────── */
.overflow-x-safe {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ─── Registration Success Page ─────────────────────────── */
@media (max-width: 640px) {
    .success-card {
        width: 100% !important;
        margin: 1rem !important;
        padding: 2rem 1.5rem !important;
    }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .success-card {
        width: 80% !important;
    }
}
@media (min-width: 1025px) {
    .success-card {
        max-width: 600px !important;
        margin: 0 auto !important;
    }
}

/* ─── Testimonial carousel: touch scrollable on mobile ─── */
@media (max-width: 768px) {
    #testimonial-track {
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
    }
    #testimonial-track .inline-block {
        scroll-snap-align: start;
        width: 85vw !important;
        margin: 0 0.5rem !important;
    }
    /* Hide fade overlays on mobile (they hide content) */
    section .absolute.left-0.top-1\\/2.w-64,
    section .absolute.right-0.top-1\\/2.w-64 {
        display: none !important;
    }
}

/* ─── Pricing cards: prevent overflow on mobile ─────────── */
@media (max-width: 640px) {
    .grid.grid-cols-3.gap-8.items-center {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    /* Professional card: remove scale */
    .transform.scale-105 {
        transform: none !important;
    }
    /* Most Popular badge position fix */
    .absolute.top-0.left-1\\/2.-translate-x-1\\/2.-translate-y-1\\/2 {
        position: relative !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        display: inline-block !important;
        margin-bottom: 1rem !important;
    }
}

/* ─── Accordion: improve tap target ────────────────────── */
.accordion-header {
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* ─── Register.php responsive ───────────────────────────── */
@media (max-width: 768px) {
    body.bg-primary.flex.flex-col.lg\\:flex-row {
        flex-direction: column !important;
    }
    .hidden.lg\\:flex.lg\\:w-1\\/2 {
        display: none !important;
    }
    .w-full.lg\\:w-1\\/2 {
        width: 100% !important;
        padding: 2rem 1.25rem !important;
    }
}

/* ─── Login page ────────────────────────────────────────── */
@media (max-width: 640px) {
    .login-split-left { display: none !important; }
    .login-split-right {
        width: 100% !important;
        padding: 2rem 1.25rem !important;
        min-height: 100vh;
    }
}
