/* ===========================================================================
   Privacy Policy — Professional layout (AMI Q360)
   Tokens bound to AMI theme; bridge CSS refines live theme tracking.
   ========================================================================== */

:root {
    --privacy-primary: var(--ami-brand-600, #059669);
    --privacy-primary-dark: var(--ami-brand-700, #047857);
    --privacy-primary-light: var(--ami-brand-400, #34d399);
    --privacy-accent: var(--ami-accent, #0f9b8e);
    --privacy-surface: var(--ami-surface, #ffffff);
    --privacy-surface-2: var(--ami-surface-2, #f5faf7);
    --privacy-canvas: var(--ami-canvas, #f3f7f5);
    --privacy-text: var(--ami-text, #0b2a22);
    --privacy-text-muted: var(--ami-text-muted, #6b8279);
    --privacy-border: var(--ami-border, rgba(11, 42, 34, 0.12));
    --privacy-shadow: var(--ami-sh-lg, 0 24px 60px rgba(2, 44, 34, 0.12));
    --privacy-shadow-sm: var(--ami-sh-sm, 0 8px 24px rgba(2, 44, 34, 0.08));
    --privacy-radius: var(--ami-r-lg, 20px);
    --privacy-radius-sm: var(--ami-r-md, 12px);
    --privacy-grad: var(--ami-grad-brand, linear-gradient(135deg, #059669 0%, #047857 100%));
    --privacy-transition: var(--ami-base, 0.35s) var(--ami-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

html {
    scroll-behavior: smooth;
}

body.privacy-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--privacy-canvas);
    color: var(--privacy-text);
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

html[dir="rtl"] body.privacy-page {
    font-family: 'Cairo', 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── Ambient background ── */
.privacy-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.privacy-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    animation: privacy-float 22s ease-in-out infinite;
}

.privacy-orb-1 {
    width: 420px;
    height: 420px;
    background: var(--privacy-primary);
    top: -120px;
    left: -80px;
}

.privacy-orb-2 {
    width: 360px;
    height: 360px;
    background: var(--privacy-accent);
    bottom: 10%;
    right: -100px;
    animation-delay: -8s;
}

.privacy-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--ami-brand-rgb, 5, 150, 105), 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--ami-brand-rgb, 5, 150, 105), 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
}

@keyframes privacy-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(24px, -18px) scale(1.06); }
}

/* ── Header ── */
.privacy-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px) saturate(1.2);
    background: color-mix(in srgb, var(--privacy-surface) 78%, transparent);
    border-bottom: 1px solid var(--privacy-border);
}

.privacy-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 16px;
}

.privacy-logo img {
    height: 52px;
    width: auto;
    display: block;
}

.privacy-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.privacy-header-link {
    align-items: center;
    gap: 8px;
    color: var(--privacy-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--privacy-transition);
}

.privacy-header-link:hover {
    color: var(--privacy-primary);
}

.privacy-header-cta {
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--privacy-grad);
    color: #fff !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--ami-sh-brand, 0 10px 28px rgba(5, 150, 105, 0.28));
    transition: transform var(--privacy-transition), filter var(--privacy-transition);
}

.privacy-header-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    color: #fff !important;
}

.privacy-theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(var(--ami-brand-rgb, 5, 150, 105), 0.22);
    background: rgba(var(--ami-brand-rgb, 5, 150, 105), 0.10);
    color: var(--privacy-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--privacy-transition);
    padding: 0;
}

.privacy-theme-toggle:hover {
    background: var(--privacy-primary);
    border-color: var(--privacy-primary);
    color: #fff;
    transform: rotate(180deg) scale(1.06);
}

#theme-icon-light { display: none; color: #ffc107; }
#theme-icon-dark { display: block; color: #6b8cff; }
#theme-icon-appearance { color: #8b6cff; }

/* ── Main / Hero ── */
.privacy-main {
    position: relative;
    z-index: 1;
    flex: 1;
}

.privacy-hero {
    padding: 48px 0 28px;
    text-align: center;
}

.privacy-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(var(--ami-brand-rgb, 5, 150, 105), 0.12);
    border: 1px solid rgba(var(--ami-brand-rgb, 5, 150, 105), 0.22);
    color: var(--privacy-primary-dark);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 18px;
    animation: privacy-rise 0.7s var(--ami-ease, ease) both;
}

.privacy-hero-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 12px;
    color: var(--privacy-text);
    animation: privacy-rise 0.7s 0.08s var(--ami-ease, ease) both;
}

.privacy-hero-title-ar {
    display: block;
    margin-top: 6px;
    font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    color: var(--privacy-primary);
}

.privacy-hero-lead {
    max-width: 560px;
    margin: 0 auto 18px;
    color: var(--privacy-text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    animation: privacy-rise 0.7s 0.14s var(--ami-ease, ease) both;
}

.privacy-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 28px;
    color: var(--privacy-text-muted);
    font-size: 0.875rem;
    animation: privacy-rise 0.7s 0.2s var(--ami-ease, ease) both;
}

.privacy-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.privacy-meta i {
    color: var(--privacy-primary);
}

@keyframes privacy-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Document ── */
.privacy-content {
    padding: 12px 0 56px;
}

.privacy-doc {
    background: color-mix(in srgb, var(--privacy-surface) 92%, transparent);
    border: 1px solid var(--privacy-border);
    border-radius: var(--privacy-radius);
    box-shadow: var(--privacy-shadow);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.privacy-lang-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--privacy-grad);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.privacy-lang-labels span {
    padding: 12px 28px;
    text-align: center;
}

.privacy-lang-labels span:last-child {
    font-family: 'Cairo', sans-serif;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.22);
}

.privacy-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--privacy-border);
    animation: privacy-rise 0.55s calc(0.05s * var(--i, 0)) var(--ami-ease, ease) both;
}

.privacy-section:nth-child(even) {
    background: color-mix(in srgb, var(--privacy-surface-2) 55%, transparent);
}

.privacy-section-en,
.privacy-section-ar {
    padding: 22px 28px;
}

.privacy-section-en {
    border-inline-end: 1px solid var(--privacy-border);
}

.privacy-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--privacy-text);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.privacy-section-ar h2 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.privacy-section p {
    margin: 0;
    color: var(--privacy-text-muted);
    line-height: 1.75;
    font-size: 0.95rem;
}

.privacy-section a {
    color: var(--privacy-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--privacy-primary) 35%, transparent);
    transition: border-color var(--privacy-transition), color var(--privacy-transition);
}

.privacy-section a:hover {
    color: var(--privacy-primary-dark);
    border-bottom-color: var(--privacy-primary);
}

/* ── Actions ── */
.privacy-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.privacy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 650;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: var(--privacy-transition);
}

.privacy-btn-primary {
    background: var(--privacy-grad);
    color: #fff !important;
    box-shadow: var(--ami-sh-brand, 0 10px 28px rgba(5, 150, 105, 0.28));
}

.privacy-btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    color: #fff !important;
}

.privacy-btn-ghost {
    background: var(--privacy-surface);
    color: var(--privacy-text) !important;
    border: 1px solid var(--privacy-border);
}

.privacy-btn-ghost:hover {
    border-color: var(--privacy-primary);
    color: var(--privacy-primary) !important;
}

/* ── Footer ── */
.privacy-footer {
    position: relative;
    z-index: 1;
    padding: 22px 0;
    border-top: 1px solid var(--privacy-border);
    background: color-mix(in srgb, var(--privacy-surface) 70%, transparent);
    backdrop-filter: blur(10px);
}

.privacy-footer .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.privacy-footer p {
    margin: 0;
    color: var(--privacy-text-muted);
    font-size: 0.875rem;
}

.privacy-footer-links {
    display: flex;
    gap: 18px;
}

.privacy-footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--privacy-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

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

/* ── Responsive ── */
@media (max-width: 768px) {
    .privacy-lang-labels,
    .privacy-section {
        grid-template-columns: 1fr;
    }

    .privacy-lang-labels span:last-child,
    .privacy-section-en {
        border-inline-end: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    }

    .privacy-section-en {
        border-bottom: 1px solid var(--privacy-border);
    }

    .privacy-section-en,
    .privacy-section-ar {
        padding: 18px 20px;
    }

    .privacy-hero {
        padding: 32px 0 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .privacy-orb,
    .privacy-hero-badge,
    .privacy-hero-title,
    .privacy-hero-lead,
    .privacy-meta,
    .privacy-section {
        animation: none !important;
    }

    .privacy-theme-toggle:hover {
        transform: none;
    }
}
