/* ============================================
   WATIKA.MA — Design System Variables
   Mobile-first, RTL-first, Dark mode
   ============================================ */

:root {
    /* === Color Palette — Moroccan Legal Directory Archetype === */
    --primary: #0F766E;          /* Deep Moroccan Emerald */
    --primary-light: #14B8A6;    /* Mint Glow Accent */
    --primary-lighter: #2DD4BF;
    --primary-dark: #115E59;
    --primary-glow: rgba(20, 184, 166, 0.16);

    --accent: #D97706;           /* Moroccan Amber / Warm Gold */
    --accent-light: #FBBF24;
    --accent-dark: #B45309;
    --accent-glow: rgba(217, 119, 6, 0.16);

    /* Dark Theme Surface Hierarchy */
    --bg-body: #0B1120;
    --bg-surface: #0F172A;
    --bg-card: #131E32;
    --bg-card-hover: #1A2844;
    --bg-elevated: #1E2D4A;
    --bg-input: #0F172A;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-on-primary: #FFFFFF;

    --border: #1E2E4A;
    --border-light: #2A3E62;
    --border-focus: var(--primary-light);

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    /* Glass effect */
    --glass-bg: rgba(19, 30, 50, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);

    /* === Typography === */
    --font-ar: 'Cairo', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
    --font-fr: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.8125rem;   /* 13px */
    --text-base: 0.9375rem; /* 15px */
    --text-md: 1rem;        /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.3125rem;   /* 21px */
    --text-2xl: 1.625rem;   /* 26px */
    --text-3xl: 2rem;       /* 32px */
    --text-4xl: 2.5rem;     /* 40px */

    --leading-tight: 1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.8;

    /* === Spacing === */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* === Layout === */
    --container-max: 1200px;
    --container-narrow: 800px;
    --sidebar-width: 300px;
    --header-height: 64px;

    /* === Borders & Radius === */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* === Shadows === */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* === Transitions === */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Base Reset & Globals
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-ar);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-body);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(27, 138, 90, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 168, 67, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-lighter); }

img { max-width: 100%; height: auto; display: block; }

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

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    direction: inherit;
}

ul, ol { list-style: none; }

/* ============================================
   Container & Layout
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
    position: relative;
    z-index: 1;
}

.container--narrow {
    max-width: var(--container-narrow);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    height: var(--header-height);
    transition: background var(--transition-base);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--space-4);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.header__logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: white;
    box-shadow: var(--shadow-glow);
}

.header__search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.header__search-input {
    width: 100%;
    padding: var(--space-2) var(--space-4);
    padding-right: var(--space-10);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
    outline: none;
}

.header__search-input::placeholder {
    color: var(--text-muted);
}

.header__search-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card);
}

.header__search-icon {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.header__lang-toggle {
    padding: var(--space-1) var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header__lang-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Mobile menu toggle */
.header__menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

@media (max-width: 768px) {
    .header__search {
        display: none;
    }
    .header__menu-btn {
        display: flex;
    }
}

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

.hero {
    padding: var(--space-12) 0 var(--space-8);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-4);
    background: var(--primary-glow);
    border: 1px solid rgba(27, 138, 90, 0.3);
    border-radius: var(--radius-full);
    color: var(--primary-lighter);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-6);
    animation: fadeInDown 0.6s ease;
}

.hero__title {
    font-size: var(--text-3xl);
    font-weight: 800;
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
    animation: fadeInUp 0.6s ease 0.1s both;
}

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

.hero__subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-8);
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* Hero search */
.hero__search {
    max-width: 600px;
    margin: 0 auto var(--space-6);
    position: relative;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero__search-input {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    padding-left: 60px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: var(--text-md);
    outline: none;
    transition: all var(--transition-base);
}

.hero__search-input::placeholder {
    color: var(--text-muted);
}

.hero__search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-lg);
}

.hero__search-btn {
    position: absolute;
    left: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-lg);
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
}

.hero__search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* Search suggestions */
.hero__search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: var(--space-2);
    padding: var(--space-2);
    display: none;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.hero__search-suggestions.active { display: block; }

.hero__search-suggestion {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: background var(--transition-fast);
}

.hero__search-suggestion:hover {
    background: var(--bg-elevated);
}

/* Popular tags */
.hero__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero__tag {
    padding: var(--space-1) var(--space-3);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.hero__tag:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ============================================
   STATS BAR
   ============================================ */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    padding: var(--space-6) 0;
}

.stat-item {
    text-align: center;
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.stat-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-item__number {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--primary-light);
    display: block;
}

.stat-item__label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

@media (max-width: 640px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   SECTION HEADERS
   ============================================ */

.section {
    padding: var(--space-10) 0;
}

.section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.section__title {
    font-size: var(--text-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.section__title-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-glow);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: var(--text-sm);
}

.section__link {
    font-size: var(--text-sm);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.section__link:hover { gap: var(--space-2); }

/* ============================================
   CATEGORY GRID
   ============================================ */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-4);
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-6) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.category-card:hover::before { transform: scaleX(1); }

.category-card__icon {
    width: 48px;
    height: 48px;
    background: var(--primary-glow);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--primary-light);
    margin-bottom: var(--space-3);
    transition: all var(--transition-base);
}

.category-card:hover .category-card__icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: scale(1.1);
}

.category-card__name {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.category-card__count {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    .category-card { padding: var(--space-4) var(--space-3); }
}

/* ============================================
   DOCUMENT CARDS
   ============================================ */

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.doc-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    transform: scaleY(0);
    transition: transform var(--transition-base);
    transform-origin: top;
}

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

.doc-card:hover::after { transform: scaleY(1); }

.doc-card__category {
    font-size: var(--text-xs);
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.doc-card__title {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: var(--leading-tight);
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.doc-card__title a {
    color: inherit;
    text-decoration: none;
}

.doc-card__title a:hover { color: var(--primary-light); }

.doc-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.doc-card__meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.doc-card__actions {
    display: flex;
    gap: var(--space-2);
    margin-top: auto;
    flex-wrap: wrap;
}

/* ============================================
   MINI-PAPER DOCUMENT MOCKUP
   ============================================ */

.doc-card__mockup {
    width: 100%;
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-4);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    min-height: 148px;
}

.mini-paper {
    width: 100%;
    max-width: 250px;
    background: #ffffff;
    color: #1e293b;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 10px 14px 12px;
    position: relative;
    font-family: var(--font-arabic);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.doc-card:hover .mini-paper {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mini-paper__fold {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 12px 0 0;
    border-color: rgba(0, 0, 0, 0.18) transparent transparent transparent;
}

.mini-paper__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 5px;
    margin-bottom: 7px;
}

.mini-paper__tag {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.3px;
}

.mini-paper__badge {
    font-size: 8px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-paper__badge--docx {
    background: #2563eb;
    color: #ffffff;
}

.mini-paper__badge--pdf {
    background: #dc2626;
    color: #ffffff;
}

.mini-paper__title-preview {
    font-size: 11px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    text-align: right;
    direction: rtl;
}

.mini-paper__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.mini-paper__line {
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
}

.mini-paper__line.w-100 { width: 100%; }
.mini-paper__line.w-95 { width: 95%; }
.mini-paper__line.w-90 { width: 90%; }
.mini-paper__line.w-85 { width: 85%; }
.mini-paper__line.w-70 { width: 70%; }
.mini-paper__line.w-60 { width: 60%; }

.mini-paper__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 5px;
    border-top: 1px solid #f1f5f9;
}

.mini-paper__seal {
    color: #dc2626;
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.mini-paper__sig {
    color: #475569;
    opacity: 0.55;
    display: flex;
    align-items: center;
}

.doc-card__mockup--image {
    padding: 0;
    height: 160px;
}

.mini-paper__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

[data-theme="light"] .doc-card__mockup {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #e2e8f0;
}

[data-theme="light"] .mini-paper {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .doc-card:hover .mini-paper {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    color: white;
}

.btn--secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn--secondary:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    color: var(--primary-light);
}

.btn--outline {
    background: transparent;
    color: var(--primary-light);
    border-color: var(--primary);
}

.btn--outline:hover {
    background: var(--primary-glow);
}

.btn--copy {
    background: var(--bg-elevated);
    color: var(--accent);
    border-color: var(--border);
}

.btn--copy:hover {
    border-color: var(--accent);
    background: rgba(212, 168, 67, 0.1);
}

.btn--copy.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn--download {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn--download:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    color: white;
}

.btn--sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

.btn--lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-md);
    border-radius: var(--radius-lg);
}

.btn--block {
    width: 100%;
}

/* ============================================
   DOCUMENT CONTENT BOX
   ============================================ */

.content-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.content-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.content-box__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.content-box__body {
    padding: var(--space-6);
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    white-space: pre-wrap;
    word-wrap: break-word;
    direction: rtl;
    text-align: right;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
}

.content-box__body::-webkit-scrollbar {
    width: 6px;
}

.content-box__body::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.content-box__body::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

/* ============================================
   DOWNLOAD SECTION
   ============================================ */

/* ============================================
   DOCUMENT READER & TOOLBAR (UI/UX PRO MAX)
   ============================================ */

.doc-sheet {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 12px 35px -8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.doc-sheet:hover {
    border-color: var(--border-light);
    box-shadow: 0 18px 45px -10px rgba(0, 0, 0, 0.6), 0 0 20px var(--primary-glow);
}

.doc-sheet__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.doc-sheet__title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.doc-sheet__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.reader-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    height: 36px;
    padding: 0 var(--space-3);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reader-control-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--primary-light);
}

.reader-control-btn:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.btn--copy-pill {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 2px 10px var(--primary-glow);
}

.btn--copy-pill:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.btn--copy-pill.is-copied {
    background: var(--success);
    border-color: var(--success);
    color: #FFFFFF;
}

.doc-sheet__body {
    padding: var(--space-8) var(--space-8);
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-ar);
    min-height: 240px;
    max-height: 650px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(15, 118, 110, 0.03), transparent 60%);
    transition: font-size var(--transition-fast);
}

.doc-sheet__body.font-sm {
    font-size: var(--text-sm);
    line-height: 1.7;
}

.doc-sheet__body.font-lg {
    font-size: var(--text-xl);
    line-height: 1.9;
}

.doc-sheet__body::-webkit-scrollbar {
    width: 6px;
}

.doc-sheet__body::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

.doc-sheet__body::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

/* ============================================
   EMBEDDED PDF VIEWER COMPONENT
   ============================================ */
.pdf-sheet {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.pdf-sheet:hover {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.15);
}

.pdf-sheet__toolbar {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.pdf-tag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #EF4444;
}

.pdf-badge-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-full);
}

.pdf-embed-wrapper {
    position: relative;
    width: 100%;
    height: 740px;
    background: #2D3748;
    overflow: hidden;
}

.pdf-embed-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.pdf-sheet__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.pdf-sheet__hint {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.pdf-external-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.pdf-external-link:hover {
    color: var(--primary);
    text-decoration: underline;
    transform: translateX(var(--current-lang-dir-offset, -2px));
}

@media (max-width: 768px) {
    .pdf-embed-wrapper {
        height: 520px;
    }
}

/* ============================================
   DOWNLOAD CARDS (MODERNIZED)
   ============================================ */

.download-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    padding: var(--space-4) 0 var(--space-6);
}

.download-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.download-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.download-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
}

.download-card--word:hover {
    border-color: #3B82F6;
    box-shadow: 0 12px 30px -8px rgba(59, 130, 246, 0.25);
}

.download-card--pdf:hover {
    border-color: #EF4444;
    box-shadow: 0 12px 30px -8px rgba(239, 68, 68, 0.25);
}

.download-card__icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-card__icon-wrap--word {
    background: rgba(59, 130, 246, 0.12);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.download-card__icon-wrap--pdf {
    background: rgba(239, 68, 68, 0.12);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.download-card__content {
    flex: 1;
    min-width: 0;
}

.download-card__label {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.download-card__size {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.download-card__arrow {
    color: var(--text-muted);
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.download-card:hover .download-card__arrow {
    color: var(--text-primary);
    transform: translateX(-4px);
}

[dir="ltr"] .download-card:hover .download-card__arrow {
    transform: translateX(4px);
}

/* ============================================
   TOAST NOTIFICATION SYSTEM
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.toast {
    background: #0F172A;
    color: #F8FAFC;
    border: 1px solid var(--primary-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px var(--primary-glow);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast__icon {
    color: var(--primary-light);
}

/* ============================================
   MOBILE STICKY ACTION DOCK
   ============================================ */

.mobile-dock {
    display: none;
}

@media (max-width: 768px) {
    .mobile-dock {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        background: rgba(11, 17, 32, 0.88);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
        padding: var(--space-2) var(--space-4);
        padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
        gap: var(--space-3);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    .mobile-dock__btn {
        flex: 1;
        height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        font-size: var(--text-sm);
        font-weight: 700;
        border-radius: var(--radius-lg);
        text-decoration: none;
        cursor: pointer;
        transition: transform var(--transition-fast);
    }

    .mobile-dock__btn:active {
        transform: scale(0.97);
    }

    .mobile-dock__btn--copy {
        background: var(--bg-card);
        color: var(--text-primary);
        border: 1px solid var(--border-light);
    }

    .mobile-dock__btn--download {
        background: var(--primary);
        color: #FFFFFF;
        border: none;
        box-shadow: 0 2px 10px var(--primary-glow);
    }

    body.has-mobile-dock {
        padding-bottom: 70px;
    }
}

/* ============================================
   KEYBOARD SHORTCUT BADGE
   ============================================ */

.kbd-shortcut {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    line-height: 1;
}

/* ============================================
   SVG ICON UTILITIES
   ============================================ */

.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
}

/* ============================================
   PRINT STYLESHEET (PROFESSIONAL LEGAL OUTPUT)
   ============================================ */

@media print {
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
        font-size: 12pt !important;
        line-height: 1.6 !important;
    }

    .header,
    .footer,
    .breadcrumb,
    .ad-zone,
    .doc-sheet__toolbar,
    .download-section,
    .mobile-dock,
    .related-section,
    .stats-bar,
    .btn,
    .toast-container {
        display: none !important;
    }

    .doc-sheet {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .doc-sheet__body {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        color: #000000 !important;
        font-size: 12pt !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--primary-light); }

.breadcrumb__sep {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.breadcrumb__current {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-8) 0;
}

.pagination__item {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination__item:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.pagination__item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: var(--space-10) 0 var(--space-6);
    margin-top: var(--space-12);
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer__brand-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-top: var(--space-3);
}

.footer__title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.footer__link {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: var(--space-1) 0;
    transition: color var(--transition-fast);
}

.footer__link:hover {
    color: var(--primary-light);
}

.footer__bottom {
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }
}

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

/* ============================================
   AD ZONES
   ============================================ */

.ad-zone {
    padding: var(--space-4) 0;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-zone--horizontal {
    min-height: 100px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
}

.ad-zone--rectangle {
    min-height: 280px;
}

.ad-zone__placeholder {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ============================================
   MOBILE SEARCH OVERLAY
   ============================================ */

.mobile-search {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-body);
    z-index: 2000;
    padding: var(--space-4);
}

.mobile-search.active { display: block; }

.mobile-search__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.mobile-search__input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-md);
    outline: none;
}

.mobile-search__close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   RESPONSIVE OVERRIDES
   ============================================ */

@media (max-width: 768px) {
    :root {
        --text-3xl: 1.625rem;
        --text-2xl: 1.3125rem;
    }

    .hero { padding: var(--space-8) 0 var(--space-6); }

    .document-grid {
        grid-template-columns: 1fr;
    }

    .section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .container { padding: 0 var(--space-3); }

    .doc-card__actions {
        flex-direction: column;
    }

    .doc-card__actions .btn {
        width: 100%;
    }

    .download-section {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--primary-light); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   INTERMEDIATE DOWNLOAD GATE (ADSENSE OPTIMIZED)
   ============================================ */

.download-gate {
    max-width: 820px;
    margin: 0 auto;
    padding: var(--space-6) 0 var(--space-12);
}

.download-gate__card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.download-gate__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
}

.download-gate__security-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.download-gate__title {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
}

.download-gate__file-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-8);
}

.download-gate__timer-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-6);
}

.download-gate__svg-ring {
    transform: rotate(-90deg);
}

.download-gate__ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

[data-theme="light"] .download-gate__ring-bg {
    stroke: #e2e8f0;
}

.download-gate__ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.72;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.download-gate__counter {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.download-gate__num {
    font-size: 34px;
    font-weight: 900;
    color: var(--primary-light);
    line-height: 1;
    font-family: var(--font-latin);
}

.download-gate__unit {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 2px;
}

.download-gate__status-text {
    font-size: var(--text-md);
    color: var(--text-secondary);
    min-height: 28px;
    margin-bottom: var(--space-6);
    font-weight: 600;
    transition: all var(--transition-base);
}

.download-gate__actions {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.download-gate__btn-ready {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    font-weight: 800;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    transition: all var(--transition-base);
    animation: pulseGlow 2s infinite ease-in-out;
}

.download-gate__btn-ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.5);
    color: #ffffff;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }
}

.download-gate__fallback {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.download-gate__fallback a {
    color: var(--primary-light);
    text-decoration: underline;
    font-weight: 600;
}

.download-gate__features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}

.download-gate__feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.download-gate__feature-item span:first-child {
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .download-gate__features {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    .download-gate__title {
        font-size: var(--text-xl);
    }
}

/* ============================================
   GEO CITABLE LEGAL SUMMARY & FAQ SECTION
   ============================================ */

.legal-summary-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(37, 99, 235, 0.03) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .legal-summary-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    border-color: #bbf7d0;
}

.legal-summary-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.legal-summary-card__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--text-primary);
}

.legal-summary-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-radius: var(--radius-full);
}

.legal-summary-card__passage {
    font-size: var(--text-sm);
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    text-align: justify;
}

.legal-summary-card__meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

[data-theme="light"] .legal-summary-card__meta-tags {
    border-top-color: #e2e8f0;
}

.legal-summary-card__tag-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.legal-summary-card__tag-item strong {
    color: var(--text-primary);
}

/* FAQ Accordion Section */
.faq-section {
    margin-bottom: var(--space-8);
}

.faq-section__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-item[open] {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.faq-item__summary {
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-primary);
    user-select: none;
    list-style: none;
}

.faq-item__summary::-webkit-details-marker {
    display: none;
}

.faq-item__summary:hover {
    color: var(--primary-light);
}

.faq-item__icon {
    display: flex;
    align-items: center;
    transition: transform var(--transition-base);
    color: var(--text-muted);
}

.faq-item[open] .faq-item__icon {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.faq-item__content {
    padding: 0 var(--space-5) var(--space-4);
    font-size: var(--text-sm);
    line-height: 1.8;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    margin-top: 2px;
    padding-top: var(--space-3);
}

/* ============================================
   INTERACTIVE DOWNLOAD CARDS (ENHANCED UI/UX)
   ============================================ */

.download-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-4);
    margin-top: var(--space-3);
}

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

.download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Moving Light Sheen / Shimmer on Hover */
.download-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        60deg,
        transparent 30%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 70%
    );
    transform: rotate(25deg);
    transition: transform 0.75s ease-in-out;
    pointer-events: none;
}

.download-card:hover::after {
    transform: rotate(25deg) translate(50%, 50%);
}

/* Word Card Theme */
.download-card--word {
    border-color: rgba(37, 99, 235, 0.3);
}

.download-card--word::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.6), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.download-card--word:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: #3b82f6;
    box-shadow: 0 14px 35px -6px rgba(37, 99, 235, 0.35), 0 0 20px rgba(37, 99, 235, 0.18);
}

/* PDF Card Theme */
.download-card--pdf {
    border-color: rgba(220, 38, 38, 0.3);
}

.download-card--pdf::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.6), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.download-card--pdf:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: #ef4444;
    box-shadow: 0 14px 35px -6px rgba(220, 38, 38, 0.35), 0 0 20px rgba(220, 38, 38, 0.18);
}

/* Icon Squircle Container */
.download-card__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    position: relative;
}

.download-card--word .download-card__icon-wrap {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.download-card--pdf .download-card__icon-wrap {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

.download-card:hover .download-card__icon-wrap {
    transform: scale(1.1) rotate(-3deg);
}

/* Content Area */
.download-card__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.download-card__header-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.download-card__label {
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--text-primary);
    transition: color var(--transition-base);
}

.download-card:hover .download-card__label {
    color: var(--primary-light);
}

.download-card__badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.download-card--word .download-card__badge-pill {
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.download-card--pdf .download-card__badge-pill {
    background: rgba(220, 38, 38, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.download-card__size {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-weight: 500;
}

/* CTA Pill Button on Left */
.download-card__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.download-card--word .download-card__cta {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.download-card--word:hover .download-card__cta {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.download-card--pdf .download-card__cta {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.download-card--pdf:hover .download-card__cta {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45);
}

.download-card__arrow {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.download-card:hover .download-card__arrow {
    transform: translateX(-5px);
}

/* Trust / Guarantee ribbon below download */
.download-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    font-size: var(--text-xs);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.download-guarantee__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.download-guarantee__item svg {
    color: #10b981;
}

/* Light mode overrides */
[data-theme="light"] .download-card {
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
    border-color: #e2e8f0;
}

[data-theme="light"] .download-card--word:hover {
    box-shadow: 0 16px 32px -6px rgba(37, 99, 235, 0.22);
}

[data-theme="light"] .download-card--pdf:hover {
    box-shadow: 0 16px 32px -6px rgba(220, 38, 38, 0.22);
}

[data-theme="light"] .download-guarantee {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* Download Card Mobile Responsiveness */
@media (max-width: 480px) {
    .download-card {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
    }
    .download-card__header-row {
        flex-wrap: wrap;
        gap: 4px;
    }
    .download-card__label {
        font-size: var(--text-sm);
    }
    .download-card__icon-wrap {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 360px) {
    .download-card {
        padding: var(--space-2) var(--space-3);
        gap: var(--space-2);
    }
    .download-card__label {
        font-size: var(--text-xs);
    }
    .download-card__badge-pill {
        font-size: 9px;
        padding: 1px 6px;
    }
    .download-card__cta span {
        display: none;
    }
    .download-card__cta {
        padding: 6px 10px;
    }
    .download-card__icon-wrap {
        width: 36px;
        height: 36px;
    }
}
