/* ============================================
   LAWFUL — Design System
   A restrained, confident dark monochrome.
   Inter for UI, Instrument Serif for display.
   ============================================ */

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

:root {
    /* Surfaces */
    --bg-base: #0a0b0d;
    --bg-elevated: #101217;
    --bg-card: rgba(22, 24, 29, 0.72);
    --bg-card-solid: #14161b;
    --bg-overlay: rgba(8, 9, 11, 0.6);
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-active: rgba(255, 255, 255, 0.08);
    --bg-subtle: rgba(255, 255, 255, 0.02);

    /* Text */
    --white: #ffffff;
    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.66);
    --text-tertiary: rgba(245, 245, 247, 0.42);
    --text-dim: rgba(245, 245, 247, 0.26);
    --text-dark: #0a0b0d;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.22);

    /* Accent — a restrained warm champagne used ONLY for emphasis */
    --accent: #d7bfa0;
    --accent-muted: rgba(215, 191, 160, 0.7);
    --accent-soft: rgba(215, 191, 160, 0.14);
    --accent-glow: rgba(215, 191, 160, 0.3);

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Instrument Serif', 'Times New Roman', Georgia, serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --transition: 240ms var(--ease-out);
    --transition-slow: 420ms var(--ease-out);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-round: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 48px -8px var(--accent-glow);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-size: 16px;
}

@media (max-width: 1200px) { html { font-size: 15.5px; } }
@media (max-width: 768px)  { html { font-size: 15px; } }
@media (max-width: 360px)  { html { font-size: 14.5px; } }

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-base);
    line-height: 1.6;
    font-weight: 400;
    font-feature-settings: "cv11", "ss01", "ss03";
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

::selection {
    background: var(--accent-soft);
    color: var(--white);
}

strong, b { color: var(--white); font-weight: 600; }

h1, h2, h3, h4, h5, h6 {
    color: var(--white);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   PAGE BACKGROUNDS
   ============================================ */

.landing-page {
    position: relative;
    background: var(--bg-base);
}

.landing-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(215, 191, 160, 0.08), transparent 60%),
        radial-gradient(ellipse 60% 40% at 10% 20%, rgba(100, 120, 160, 0.05), transparent 60%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(215, 191, 160, 0.04), transparent 60%),
        linear-gradient(180deg, #0a0b0d 0%, #0c0d10 100%);
    pointer-events: none;
}

.landing-page::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.025 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.6;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.landing-page > * { position: relative; z-index: 1; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    height: 2.625rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), transform var(--transition),
                box-shadow var(--transition);
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--white);
    color: var(--text-dark);
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 6px 16px -6px rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
    background: #f0f0f2;
    box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 10px 24px -6px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-primary:hover:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--white);
}

.btn-lg {
    padding: 0 1.75rem;
    height: 3rem;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0 0.875rem;
    height: 2rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.btn-full { width: 100%; }

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 11, 13, 0.7);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.01em;
}

.nav-logo svg { flex-shrink: 0; }

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

.nav-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 450;
    letter-spacing: -0.005em;
    transition: color var(--transition);
}

.nav-links a:hover { color: var(--white); }

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

.nav-mobile-toggle {
    display: none;
    color: var(--white);
    padding: 0.5rem;
}

@media (max-width: 900px) {
    .nav-links, .nav-actions { display: none; }
    .nav-mobile-toggle { display: flex; }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: rgba(10, 11, 13, 0.95);
        padding: 1rem 1.5rem 1.5rem;
        border-bottom: 1px solid var(--border-subtle);
        backdrop-filter: blur(16px);
    }
    .nav-links.active a { padding: 0.625rem 0; }
}

/* ============================================
   HERO
   ============================================ */

.hero {
    position: relative;
    padding: 10rem 1.5rem 7rem;
    text-align: center;
    overflow: hidden;
}

.hero-container {
    max-width: 820px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-round);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
    margin-bottom: 1.75rem;
    backdrop-filter: blur(10px);
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 6.5vw, 4.75rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.hero-highlight {
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
    position: relative;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 2.25rem;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 5rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-subtle);
}

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

.hero-stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 400;
    color: var(--white);
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 0.375rem;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hero-stat-divider {
    width: 1px;
    height: 2.5rem;
    background: var(--border-subtle);
}

.hero-glow {
    position: absolute;
    top: -220px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 700px;
    background:
        radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 55%);
    pointer-events: none;
    filter: blur(30px);
}

@media (max-width: 768px) {
    .hero { padding: 7rem 1.5rem 5rem; }
    .hero-actions { flex-direction: column; gap: 0.75rem; }
    .hero-actions .btn { width: 100%; }
    .hero-stats { flex-direction: column; gap: 1.5rem; }
    .hero-stat-divider { width: 2.5rem; height: 1px; }
    .hero-stat-number { font-size: 2.25rem; }
}

/* ============================================
   TRUSTED BY
   ============================================ */

.trusted {
    padding: 3.5rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
}

.trusted-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.75rem;
}

.trusted-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.trusted-logos:hover { opacity: 1; }

.trusted-logo {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0;
    font-style: italic;
}

/* ============================================
   SECTIONS & SECTION HEADERS
   ============================================ */

section { position: relative; }

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.section-tag {
    display: inline-block;
    padding: 0.3125rem 0.75rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-round);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.875rem, 4vw, 2.875rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.55;
    font-weight: 400;
}

/* ============================================
   FEATURES
   ============================================ */

.features { padding: 6.5rem 0; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.feature-card {
    position: relative;
    padding: 1.75rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0) 100%),
        var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), background var(--transition),
                transform var(--transition), box-shadow var(--transition);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at top, rgba(255,255,255,0.04), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.feature-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-card:hover::after { opacity: 1; }

.feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--white);
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-weight: 400;
}

@media (max-width: 900px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features-grid { grid-template-columns: 1fr; } }

/* ============================================
   MODULES
   ============================================ */

.modules {
    padding: 6.5rem 0;
    border-top: 1px solid var(--border-subtle);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.module-card {
    position: relative;
    padding: 2rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0) 50%),
        var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), background var(--transition),
                transform var(--transition), box-shadow var(--transition);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.module-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.module-number {
    position: absolute;
    top: 1.5rem;
    right: 1.75rem;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.08);
    line-height: 1;
    letter-spacing: -0.02em;
}

.module-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.module-card h3 {
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 0.25rem;
    color: var(--white);
}

.module-tagline {
    font-size: 0.8125rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 0.015em;
    margin-bottom: 1rem;
    text-transform: none;
}

.module-card > p:last-of-type {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.module-capabilities {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.module-capabilities li {
    padding: 0.3125rem 0.6875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-round);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
}

@media (max-width: 768px) { .modules-grid { grid-template-columns: 1fr; } }

/* ============================================
   HOW IT WORKS
   ============================================ */

.how-it-works {
    padding: 6.5rem 0;
    border-top: 1px solid var(--border-subtle);
}

.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.step-card {
    flex: 1;
    max-width: 320px;
    text-align: center;
    padding: 2rem 1.5rem;
}

.step-number {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid rgba(215, 191, 160, 0.3);
    color: var(--accent);
    border-radius: var(--radius-round);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1.25rem;
}

.step-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: var(--white);
    letter-spacing: -0.01em;
}

.step-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-weight: 400;
}

.step-connector {
    display: flex;
    align-items: center;
    padding-top: 3.25rem;
    flex-shrink: 0;
}

.step-connector svg line {
    stroke: var(--border-color);
}

@media (max-width: 768px) {
    .steps-grid { flex-direction: column; align-items: center; gap: 0; }
    .step-connector { transform: rotate(90deg); padding: 0; }
}

/* ============================================
   PRICING
   ============================================ */

.pricing {
    padding: 6.5rem 0;
    border-top: 1px solid var(--border-subtle);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), background var(--transition),
                transform var(--transition), box-shadow var(--transition);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pricing-card-featured {
    background:
        linear-gradient(180deg, rgba(215, 191, 160, 0.06) 0%, rgba(215, 191, 160, 0) 40%),
        var(--bg-card);
    border-color: rgba(215, 191, 160, 0.3);
    box-shadow: 0 0 0 1px rgba(215, 191, 160, 0.1), var(--shadow-md);
}

.pricing-card-featured:hover {
    border-color: rgba(215, 191, 160, 0.55);
    box-shadow: 0 0 0 1px rgba(215, 191, 160, 0.2), var(--shadow-lg), 0 0 40px -8px var(--accent-glow);
}

.pricing-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.3125rem 0.875rem;
    background: var(--accent);
    color: var(--text-dark);
    border-radius: var(--radius-round);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px -2px var(--accent-glow);
}

.pricing-tier {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.pricing-price {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.pricing-amount {
    font-family: var(--font-display);
    font-size: 3.25rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--white);
    line-height: 1;
}

.pricing-period {
    font-size: 0.9375rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.pricing-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    margin-bottom: 1.75rem;
    flex: 1;
}

.pricing-features li {
    padding: 0.4375rem 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 400;
    line-height: 1.45;
}

.pricing-features li::before {
    content: '';
    width: 1rem;
    height: 1rem;
    margin-top: 0.1875rem;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8.5L6 11.5L13 4.5' stroke='%23d7bfa0' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

@media (max-width: 900px) {
    .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

/* ============================================
   CTA
   ============================================ */

.cta {
    padding: 6.5rem 0;
    border-top: 1px solid var(--border-subtle);
}

.cta-content {
    position: relative;
    text-align: center;
    padding: 5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(ellipse 60% 80% at 50% 0%, rgba(215, 191, 160, 0.08), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0) 60%),
        var(--bg-card);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.cta-content h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--white);
}

.cta-content p {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 400;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    padding: 4.5rem 0 2.5rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--text-tertiary);
    max-width: 300px;
    font-weight: 400;
    line-height: 1.55;
}

.footer-links h4 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
}

.footer-links a {
    display: block;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    padding: 0.375rem 0;
    transition: color var(--transition);
    font-weight: 400;
}

.footer-links a:hover { color: var(--white); }

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */

.lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.75rem;
    height: 2.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    transition: all var(--transition);
}

.lang-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    color: var(--white);
}

.lang-switcher-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    color: var(--white);
}

.lang-switcher-icon {
    opacity: 0.7;
    flex-shrink: 0;
}

.lang-switcher-chevron {
    opacity: 0.55;
    transition: transform var(--transition);
    flex-shrink: 0;
}

.lang-switcher-btn[aria-expanded="true"] .lang-switcher-chevron {
    transform: rotate(180deg);
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 190px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.375rem;
    background: rgba(18, 20, 25, 0.96);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    z-index: 300;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
}

.lang-switcher.open .lang-switcher-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-switcher-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 450;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}

.lang-switcher-option:hover {
    background: var(--bg-hover);
    color: var(--white);
}

.lang-switcher-option[aria-selected="true"] {
    color: var(--white);
}

.lang-switcher-option[aria-selected="true"]::after {
    content: '';
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M2.5 7.5L5.5 10.5L11.5 4' stroke='%23d7bfa0' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.lang-switcher-option-code {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
}

/* Sidebar-embedded variant (app page) */
.sidebar-lang {
    padding: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-lang .lang-switcher { width: 100%; }

.sidebar-lang .lang-switcher-btn {
    width: 100%;
    padding: 0 0.75rem;
}

.sidebar-lang .lang-switcher-label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-lang .lang-switcher-menu {
    right: auto;
    left: 0;
    bottom: calc(100% + 0.5rem);
    top: auto;
    transform-origin: bottom left;
}

/* ============================================
   APP LAYOUT
   ============================================ */

.app-page {
    height: 100vh;
    overflow: hidden;
    background: var(--bg-base);
}

.app-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 40% at 80% 10%, rgba(215, 191, 160, 0.04), transparent 60%),
        radial-gradient(ellipse 50% 30% at 20% 90%, rgba(100, 120, 160, 0.03), transparent 60%);
    pointer-events: none;
}

.app-page > * { position: relative; z-index: 1; }

.app-layout {
    display: flex;
    height: 100vh;
}

/* --- Sidebar --- */

.sidebar {
    width: 264px;
    min-width: 264px;
    height: 100vh;
    background: rgba(14, 16, 20, 0.7);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow), min-width var(--transition-slow);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.sidebar-header {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.sidebar-section { padding: 0 0.625rem; }

.sidebar-section-label {
    display: block;
    padding: 0.5rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 450;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    text-align: left;
    letter-spacing: -0.005em;
    margin-bottom: 1px;
}

.sidebar-item svg { opacity: 0.7; transition: opacity var(--transition); flex-shrink: 0; }

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--white);
}

.sidebar-item:hover svg { opacity: 1; }

.sidebar-item.active {
    background: var(--bg-active);
    color: var(--white);
    font-weight: 500;
}

.sidebar-item.active svg { opacity: 1; color: var(--accent); }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sidebar-avatar {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(215, 191, 160, 0.25);
    border-radius: var(--radius-round);
    font-size: 0.8125rem;
    font-weight: 600;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--white);
    letter-spacing: -0.005em;
}

.sidebar-user-plan {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* --- Main --- */

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-base);
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(10, 11, 13, 0.6);
    min-height: 56px;
    backdrop-filter: blur(16px);
}

.sidebar-toggle {
    color: var(--text-tertiary);
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--white);
}

.topbar-module-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-module-info h1 {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--white);
}

.topbar-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: -0.005em;
}

/* --- Chat / Welcome --- */

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-area::-webkit-scrollbar { width: 8px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 1.5rem 3rem;
    min-height: calc(100vh - 200px);
}

.welcome-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid rgba(215, 191, 160, 0.3);
    border-radius: var(--radius-lg);
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.welcome-icon svg { width: 1.75rem; height: 1.75rem; }

.welcome-screen h2 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.welcome-screen > p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.55;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.welcome-prompts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
    max-width: 640px;
    width: 100%;
}

.welcome-prompt {
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.45;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition),
                transform var(--transition), color var(--transition);
    font-weight: 400;
    letter-spacing: -0.005em;
}

.welcome-prompt:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.welcome-prompt strong {
    display: block;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

@media (max-width: 640px) { .welcome-prompts { grid-template-columns: 1fr; } }

/* --- Messages --- */

.messages-container {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    animation: messageIn 300ms var(--ease-out);
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-user .message-content {
    background: var(--white);
    color: var(--text-dark);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.125rem;
    max-width: 75%;
    font-size: 0.9375rem;
    line-height: 1.55;
    font-weight: 450;
    letter-spacing: -0.005em;
    box-shadow: var(--shadow-sm);
}

.message-ai {
    display: flex;
    gap: 0.875rem;
}

.message-ai-avatar {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid rgba(215, 191, 160, 0.25);
    border-radius: var(--radius-round);
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent);
}

.message-ai-avatar svg {
    width: 1rem;
    height: 1rem;
}

.message-ai-avatar svg rect,
.message-ai-avatar svg path { stroke: currentColor !important; }

.message-ai .message-content {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: -0.005em;
}

.message-ai .message-content h1,
.message-ai .message-content h2,
.message-ai .message-content h3 {
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--white);
    letter-spacing: -0.015em;
}

.message-ai .message-content h1 { font-size: 1.25rem; }
.message-ai .message-content h2 { font-size: 1.125rem; }
.message-ai .message-content h3 { font-size: 1rem; }

.message-ai .message-content p { margin-bottom: 0.75rem; }

.message-ai .message-content ul,
.message-ai .message-content ol {
    margin: 0.5rem 0 0.875rem 1.5rem;
}

.message-ai .message-content li { margin-bottom: 0.375rem; }

.message-ai .message-content strong {
    font-weight: 600;
    color: var(--white);
}

.message-ai .message-content a {
    color: var(--accent);
    border-bottom: 1px solid rgba(215, 191, 160, 0.3);
    transition: border-color var(--transition);
}

.message-ai .message-content a:hover { border-bottom-color: var(--accent); }

.message-ai .message-content code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--accent);
}

.message-ai .message-content pre {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    margin: 0.875rem 0;
}

.message-ai .message-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.message-ai .message-content hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.25rem 0;
}

.message-ai .message-content blockquote {
    padding: 0.75rem 1rem;
    border-left: 2px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 0.75rem 0;
    color: var(--text-secondary);
    font-style: normal;
}

.message-ai .message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.875rem 0;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.message-ai .message-content th,
.message-ai .message-content td {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

.message-ai .message-content tr:last-child th,
.message-ai .message-content tr:last-child td { border-bottom: none; }

.message-ai .message-content th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    letter-spacing: 0;
    font-size: 0.8125rem;
    color: var(--white);
    text-transform: none;
}

/* Risk badges */
.risk-critical, .risk-high, .risk-medium, .risk-low {
    display: inline-block;
    padding: 0.0625rem 0.4375rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    vertical-align: baseline;
}

.risk-critical { color: #fca5a5; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.25); }
.risk-high     { color: #fcd34d; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); }
.risk-medium   { color: #fde68a; background: rgba(250, 204, 21, 0.1);  border: 1px solid rgba(250, 204, 21, 0.22); }
.risk-low      { color: #86efac; background: rgba(34, 197, 94, 0.1);   border: 1px solid rgba(34, 197, 94, 0.22); }

/* --- Loading --- */

.message-loading {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.loading-dots {
    display: flex;
    gap: 5px;
    padding: 1rem 0;
}

.loading-dots span {
    width: 7px;
    height: 7px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: loadingDot 1.3s infinite both;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loadingDot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40%           { opacity: 1;   transform: scale(1); }
}

/* --- Input --- */

.input-area {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(10, 11, 13, 0.6);
    backdrop-filter: blur(16px);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 820px;
    margin: 0 auto;
    padding: 0.5rem 0.5rem 0.5rem 0.375rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper:focus-within {
    border-color: rgba(215, 191, 160, 0.4);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-upload-btn {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition);
    flex-shrink: 0;
}

.input-upload-btn:hover {
    color: var(--white);
    background: var(--bg-hover);
}

.input-textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--white);
    resize: none;
    max-height: 200px;
    padding: 0.5rem 0.25rem;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.input-textarea::placeholder { color: var(--text-dim); }

.input-send-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    flex-shrink: 0;
}

.input-send-btn:hover {
    background: #f0f0f2;
    transform: translateY(-1px);
}

.input-send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.input-disclaimer {
    max-width: 820px;
    margin: 0.625rem auto 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: -0.005em;
}

/* ============================================
   MOBILE APP LAYOUT
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }
    .app-main { width: 100%; }
}

/* ============================================
   COPY BUTTON
   ============================================ */

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: rgba(22, 24, 29, 0.92);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity var(--transition), color var(--transition),
                border-color var(--transition), background var(--transition);
    letter-spacing: 0;
    text-transform: none;
}

.message-ai:hover .copy-btn { opacity: 1; }

.copy-btn:hover {
    background: var(--bg-hover);
    color: var(--white);
    border-color: var(--border-strong);
}

/* ============================================
   RTL SUPPORT (Arabic)
   ============================================ */

html[dir="rtl"] body { text-align: right; }

html[dir="rtl"] .app-layout { flex-direction: row-reverse; }

html[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-subtle);
}

html[dir="rtl"] .sidebar-lang .lang-switcher-menu {
    left: auto;
    right: 0;
    transform-origin: bottom right;
}

html[dir="rtl"] .lang-switcher-menu {
    right: auto;
    left: 0;
    transform-origin: top left;
}

html[dir="rtl"] .message-user { justify-content: flex-start; }

html[dir="rtl"] .message-ai { flex-direction: row-reverse; }

html[dir="rtl"] .pricing-features li { flex-direction: row-reverse; }

html[dir="rtl"] .btn svg:last-child { transform: scaleX(-1); }

html[dir="rtl"] .module-number { left: 1.75rem; right: auto; }

html[dir="rtl"] .module-card::before {
    background: linear-gradient(270deg, transparent, rgba(255,255,255,0.1), transparent);
}
