/* =====================================================================
   LawyerClientConnect — global theme (REBRANDED to the new design system)
   Drop-in replacement for wwwroot/style.css.
   Same class names + structure as before; only tokens, fonts, gradients,
   radii and component skins changed to match the design system.
   Font swap: Inter -> Poppins (display) + Mulish (body).
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Mulish:wght@400;500;600;700;800&display=swap');

html {
    scroll-behavior: smooth;
}

/* ========================================
   CSS Variables (Design Tokens) — brand
   ======================================== */
:root {
    --background: #F3F2EB;          /* warm off-white page bg */
    --foreground: #1c1a30;          /* navy ink */

    /* Shared layout primitives (consolidated from per-page CSS) */
    --container: 1280px;            /* standard page content width */
    --hero-grad: linear-gradient(125deg, #360019 0%, #5e022f 45%, #7e0039 72%, #920040 100%);

    --card: #ffffff;
    --card-foreground: #1c1a30;
    --popover: #ffffff;
    --popover-foreground: #1c1a30;

    --primary: #920040;             /* brand deep magenta */
    --primary-foreground: #ffffff;
    --primary-bright: #c80054;      /* bright rose */
    --primary-hover: #7c0036;

    --secondary: #c0c8e1;           /* powder blue accent */
    --secondary-foreground: #1c1a30;
    --muted: #f3f0f8;
    --muted-foreground: #6b6680;
    --accent: #c80054;
    --accent-foreground: #ffffff;
    --border: #e8e4ef;
    --input: #ffffff;
    --ring: #c80054;
    --radius: 0.75rem;              /* 12px — friendlier than the old 8px */

    /* Brand additions */
    --pink-tint: #fdf2f6;
    --grad-brand: linear-gradient(135deg, #81104c 0%, #920040 100%);
    --grad-magenta: linear-gradient(135deg, #c80054 0%, #920040 100%);
    --grad-hero: linear-gradient(135deg, #2a0016 0%, #560031 38%, #7c0039 70%, #920040 100%);
    --grad-text: linear-gradient(90deg, #c80054, #920040);
    --shadow-card: 0 12px 32px rgba(130, 16, 76, .10);
    --shadow-brand: 0 14px 32px rgba(146, 0, 64, .30);
    --shadow-sm: 0 1px 2px rgba(28,26,48,.06), 0 2px 6px rgba(28,26,48,.06);

    --font-display: 'Poppins', system-ui, -apple-system, sans-serif;
    --font-body: 'Mulish', system-ui, -apple-system, sans-serif;

    /* ---- Design-system token set (imported from design-system-reference/tokens) ---- */
    /* Brand magenta ramp */
    --maroon-900: #2a0016;
    --maroon-800: #4a0727;
    --maroon-700: #6e032f;
    --maroon-600: #81104c;
    --magenta-700: #920040;
    --magenta-500: #c80054;
    --magenta-100: #fcdde9;
    --pink-tint-2: #fbe9f0;
    --purple-500: #8e2bbf;

    /* Powder-blue accent ramp */
    --blue-300: #c0c8e1;
    --blue-100: #eef1f8;

    /* Extra gradients */
    --grad-orb: linear-gradient(150deg, #a64dd0 0%, #c80054 52%, #7a0d3f 100%);
    --grad-panel: linear-gradient(120deg, #a80a4c 0%, #920040 45%, #6e032f 100%);
    --grad-soft: linear-gradient(135deg, #fdf2f6 0%, #f3eafc 100%);

    /* Corner radii scale */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;

    /* Shadow scale */
    --shadow-xs: 0 1px 2px rgba(28,26,48,.06);
    --shadow-md: 0 6px 18px rgba(28,26,48,.08), 0 2px 6px rgba(28,26,48,.05);
    --shadow-lg: 0 18px 44px rgba(28,26,48,.14);
    --shadow-xl: 0 30px 70px rgba(28,26,48,.20);
    --shadow-float: 0 24px 60px rgba(42,0,22,.30);

    /* Spacing (4px grid) + layout rhythm */
    --space-2: 8px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 40px;
    --space-10: 64px;
    --space-12: 96px;
    --container-max: 1200px;
    --section-y: 96px;

    /* Motion */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur: 200ms;
}

/* ========================================
   CSS Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Guard against stray horizontal overflow (a too-wide element shifts centred
   content, making left/right padding look unequal on mobile). Clip it site-wide. */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

h1, h2, h3, h4, h5, .logo, .footer-brand {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
}

/* ========================================
   Utility Classes (Tailwind-compatible)
   ======================================== */
.bg-background { background-color: var(--background); }
.bg-card { background-color: var(--card); }
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-muted { background-color: var(--muted); }
.bg-input { background-color: var(--input); }
.text-foreground { color: var(--foreground); }
.text-card-foreground { color: var(--card-foreground); }
.text-primary { color: var(--primary); }
.text-primary-foreground { color: var(--primary-foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.border-border { border-color: var(--border); }

/* ========================================
   Component Classes
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.7rem 1.5rem;
    transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s, background .2s, color .2s;
    cursor: pointer;
    border: 1.5px solid transparent;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--grad-magenta);
    color: var(--primary-foreground);
    font-weight: 700;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    transform: translateY(-1px);
    opacity: 1;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

.btn.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 0.7rem 1.5rem;
}

.btn-outline:hover {
    background-color: var(--pink-tint);
    transform: translateY(-1px);
}

.btn-ghost {
    background-color: transparent;
    color: var(--foreground);
    padding: 0.7rem 1.5rem;
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--muted);
}

.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);   /* ~20px — generous brand rounding */
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s;
}

.card:hover {
    border-color: var(--border);
    box-shadow: 0 18px 44px rgba(28,26,48,.14);
    transform: translateY(-4px);
}

.input, .textarea, .select {
    width: 100%;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background-color: var(--input);
    color: var(--foreground);
    padding: 0.6rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 4px rgba(200, 0, 84, .22);
}

.textarea {
    resize: none;
}

.gradient-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promo-card {
    border-radius: 1.5rem;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.promo-card-left,
.promo-card-right {
    background: var(--grad-magenta);
}

.promo-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ========================================
   Legal Area Cards
   ======================================== */
.legal-area-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--card);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.legal-area-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 26px rgba(146, 0, 64, 0.12);
    transform: translateY(-4px);
}

.legal-area-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.legal-area-desc {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    flex: 1;
}

.legal-area-link {
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-bright);
}

.legal-area-card:hover .legal-area-link {
    text-decoration: underline;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   Responsive visibility helpers
   ======================================== */
@media (min-width: 1024px) {
    .lg\:hidden { display: none !important; }
    .lg\:flex { display: flex; }
    .lg\:block { display: block; }
}

@media (min-width: 1280px) {
    .xl\:block { display: block; }
    .xl\:flex { display: flex; }
    .xl\:min-h-screen { min-height: 100vh; }
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xl\:h-\[600px\] { height: 600px; }
}

/* ========================================
   Header
   ======================================== */
.header {
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-link {
    padding: 0.5rem 1rem;
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.header-link:hover {
    background: var(--pink-tint);
    color: var(--primary);
}

.header-link-cta {
    background: var(--grad-magenta);
    color: white;
    box-shadow: var(--shadow-brand);
}

.header-link-cta:hover {
    background: var(--grad-magenta);
    transform: translateY(-1px);
}

/* ========================================
   Buttons (legacy - used by MainLayout pages)
   ======================================== */
.btn-secondary {
    padding: 0.7rem 1.25rem;
    background: transparent;
    color: var(--muted-foreground);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--pink-tint);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    color: var(--muted-foreground);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer-section h4 {
    color: var(--foreground);
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* ========================================
   Common Components
   ======================================== */
.feature-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pink-tint);
    color: var(--primary-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--muted-foreground);
}

/* ========================================
   Contact Form (Global for Blazor components)
   ======================================== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    box-sizing: border-box;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 4px rgba(200, 0, 84, .18);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-submit {
    padding: 1rem 2rem;
    background: var(--grad-magenta);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 0.5rem;
}

.contact-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

.contact-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-success {
    text-align: center;
    padding: 2rem;
}

.form-success h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e6b5a;
    margin-bottom: 0.75rem;
}

.form-success p {
    font-size: 1rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: #b91c1c;
    font-size: 0.9375rem;
    margin-top: 0.5rem;
}

/* ========================================
   Responsive - Common
   ======================================== */
@media (max-width: 768px) {
    .header { padding: 0.75rem 1rem; }
    .header-content { flex-wrap: wrap; gap: 0.5rem; }
    .header-nav { gap: 0.25rem; }
    .header-actions { gap: 0.5rem; }
    .header-link { padding: 0.375rem 0.5rem; font-size: 0.75rem; }
    .header-link-cta { padding: 0.375rem 0.625rem; }
    .header .btn-secondary, .header .btn-primary { padding: 0.5rem 0.875rem; font-size: 0.8125rem; }
    .footer { padding: 2rem 1rem 1.5rem; }
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .header-nav { gap: 0.125rem; }
    .header-link { padding: 0.25rem 0.375rem; font-size: 0.625rem; }
    .header-link-cta { padding: 0.25rem 0.5rem; }
    .header-actions { gap: 0.375rem; }
    .header .btn-secondary, .header .btn-primary { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
    .form-group label { font-size: 0.8125rem; }
    .form-group input, .form-group select, .form-group textarea { padding: 0.75rem; font-size: 0.9375rem; }
    .contact-submit { padding: 0.875rem 1.5rem; font-size: 0.9375rem; }
}

/* ============================================================
   Hero description — ONE definition for every marketing-page hero.
   Pages must NOT redeclare font-size/line-height/max-width for these;
   only the text colour may differ per page (dark vs light hero).
   ============================================================ */
.hero-desc,
.ab-hero-desc,
.pr-hero-desc,
.hero-text > p {
    font-size: 1.12rem;
    line-height: 1.85;
    max-width: none;
}

/* Mobile: ONE size for every hero description so all pages match. */
@media (max-width: 640px) {
    .hero-desc,
    .ab-hero-desc,
    .pr-hero-desc,
    .hero-text > p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* ============================================================
   Dark-hero subtitle — ONE definition for all legal pages.
   Covers the different class names (h2 / .hero-sub / .pr-hero-tag).
   ============================================================ */
.cf-page .hero h2,
.pa-page .hero h2,
.ip-page .hero-sub,
.ab-hero-top h2,
.pr-hero-tag {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    font-weight: 500;
    color: #fff;
    line-height: 1.4;
    margin: 0 0 1.5rem;
}

/* ============================================================
   Content container — ONE definition for every marketing page.
   Pages must NOT redeclare .in width/margin/padding (delete scoped copies).
   Full-bleed sections override with `.xxx .in { max-width: none }`.
   ============================================================ */
.in {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 640px) {
    .in { padding: 0 1.25rem; }
}

/* ============================================================
   Hero button variants — ONE definition. Pages must NOT redeclare
   `.btn-light` / `.btn-magenta` (delete scoped copies). Pages with
   differently-named buttons (.ip-btn-light, .ab-btn-light) are separate.
   ============================================================ */
.btn-light { background: #fff; color: var(--primary); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.btn-magenta { background: var(--grad-magenta); color: #fff; box-shadow: 0 12px 28px rgba(146, 0, 64, .28); }

/* ============================================================
   StatBar icons render from a MarkupString (raw HTML), so they carry no
   CSS-isolation scope attribute — the scoped `.sb-icon svg` rule in
   StatBar.razor.css compiles to `svg[b-xxx]` and never matches. This global
   (unscoped) rule sizes them reliably. Without it SVGs render at their large
   intrinsic size. See StatBar.razor.css.
   ============================================================ */
.sb-icon svg { width: 40px; height: 40px; display: block; margin: 0 auto; }

/* ============================================================
   Dark marketing hero — ONE definition. The gradient sits under the
   background image. Covers the three hero class names used across pages.
   Pages must NOT redeclare .hero background/position/overflow.
   ============================================================ */
/* Only the DARK-hero legal pages (not the light Home/HowItWorks heroes). */
.pf-page .hero,
.cf-page .hero,
.pa-page .hero,
.ip-page .hero,
.pr-hero,
.ab-hero {
    position: relative;
    overflow: hidden;
    /* Two layers: image on top, gradient behind (comma-separated, not space). */
    background-image: url('/images/BACKGROUND.png'), var(--hero-grad);
    background-position: center bottom;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Mobile hero-in padding — ONE definition for all legal pages (covers hero-in variants).
   Tight top padding so the hero heading sits close under the header (no big gap). */
@media (max-width: 640px) {
    .hero-in,
    .pr-hero-in,
    .ab-hero-top {
        /* Only control the TOP gap here (header→heading). Left/right/bottom padding is
           left to each page's `.in` gutter — forcing horizontal padding here double-inset
           pages that put `.hero-in` inside an `.in` section (e.g. Home).
           !important beats page-scoped desktop `.hero-in` (scoped CSS loads after this). */
        padding-top: 1.75rem !important;
    }

    /* Light-hero pages (Home, HowItWorks) put top padding on `.hero` itself, not
       `.hero-in`. Match the same header→heading gap as the dark heroes above. */
    .home-page .hero,
    .hiw-page .hero {
        padding-top: 1.75rem !important;
    }
}
