/* ==========================================================================
   Shared design tokens + base for the public pages (index / faq / contact).
   Link this BEFORE the page stylesheet.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&family=Poppins:wght@400;500;700;900&display=swap');

:root {
    /* Brand */
    --brand: #137980;
    --brand-600: #0f636a;
    --brand-700: #0b4d53;
    --brand-100: #e2f2f3;
    --lime: #aac65d;
    --lime-600: #93b048;

    /* Surfaces */
    --bg: #ffffff;
    --bg-alt: #f5f9f9;
    --surface: #ffffff;
    --surface-2: #f7fafa;
    --border: #e3ebec;

    /* Text */
    --text: #14262a;
    --text-muted: #5c7378;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(11, 77, 83, .06), 0 2px 8px rgba(11, 77, 83, .05);
    --shadow-md: 0 4px 16px rgba(11, 77, 83, .08), 0 12px 32px rgba(11, 77, 83, .07);
    --shadow-lg: 0 12px 40px rgba(11, 77, 83, .14);
    --radius: 16px;
    --radius-lg: 24px;

    --header-h: 76px;
    --ease: cubic-bezier(.22, .61, .36, 1);
    --transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease), opacity .3s var(--ease), filter .3s var(--ease);

    /* Compatibility aliases for older stylesheets (teacher-carts.css, contact.css). */
    --primary-color: var(--bg);
    --secondary-color: var(--lime);
    --accent-color: var(--brand);
    --white: #ffffff;
    --light-gray: var(--surface-2);
    --dark-gray: #d5e0eb;
    --text-color: var(--text);
    --border-color: var(--border);
    --card-bg: var(--surface);
    --main-pg: var(--bg);
}

[data-theme="dark"] {
    --brand: #4ab3bd;
    --brand-600: #3d9aa3;
    --brand-700: #2f7d85;
    --brand-100: #16343a;
    --lime: #b9d46e;
    --lime-600: #a3c057;

    --bg: #0e1719;
    --bg-alt: #121e21;
    --surface: #162326;
    --surface-2: #1b2c30;
    --border: #253b40;

    --text: #e6eef0;
    --text-muted: #9fb4b8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);

    --primary-color: var(--bg);
    --white: var(--surface);
    --light-gray: var(--surface-2);
    --dark-gray: #3a5459;
    --text-color: var(--text);
    --border-color: var(--border);
    --card-bg: var(--surface);
    --main-pg: var(--bg);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body[dir="ltr"] { font-family: 'Poppins', sans-serif; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--brand); color: #fff; }

.container { width: min(92%, 1200px); margin-inline: auto; }

/* --------------------------------------------------------------------------
   Shared topbar — a real sticky bar, so nothing overlaps the page heading.
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    inset-block-start: 0;
    z-index: 900;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}

.topbar.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    border: 1.5px solid var(--brand);
    color: var(--brand);
    font-weight: 700;
    font-size: .95rem;
    background: var(--surface);
    transition: var(--transition);
    white-space: nowrap;
}

.back-btn:hover { background: var(--brand); color: #fff; transform: translateY(-2px); }

.theme-toggle {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.theme-toggle:hover { color: var(--brand); transform: rotate(-18deg); }

/* The language toggle reuses .theme-toggle's pill chrome but shows a word
   ("English"/"عربي"), not an icon, so it needs its own width and can't share
   the rotate-on-hover flourish. */
.theme-toggle.lang-toggle {
    width: auto;
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 600;
}

.theme-toggle.lang-toggle:hover { color: var(--brand); transform: none; }

/* --------------------------------------------------------------------------
   Shared page hero (the band under the topbar on faq/contact)
   -------------------------------------------------------------------------- */
/* No bottom border: the band fades into the page background so there is no
   sharp seam between the hero and the content below it. */
.page-hero {
    position: relative;
    text-align: center;
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4rem);
    background: linear-gradient(to bottom, var(--bg-alt) 0%, var(--bg-alt) 55%, var(--bg) 100%);
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 55%),
        radial-gradient(circle at 85% 100%, color-mix(in srgb, var(--lime) 20%, transparent), transparent 55%);
    /* Fade the tint out at the bottom edge along with the background. */
    mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
    pointer-events: none;
}

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

.page-hero h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
    font-size: clamp(1.9rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--brand);
    margin-bottom: .75rem;
}

.page-hero h1 i { color: var(--lime-600); }

.page-hero p {
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 60ch;
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Shared buttons
   -------------------------------------------------------------------------- */
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .85rem 1.9rem;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    color: #fff;
    border: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-600));
    box-shadow: 0 10px 26px rgba(19, 121, 128, .3);
}

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(19, 121, 128, .4); }

.btn-ghost {
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-3px); }

/* Cross-links between the standalone pages (privacy / terms / protection), so a
   reader who lands on one finds the others. Shared here rather than in
   legal.css because contact.html uses it and does not load that file. */
.legal-siblings {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
    margin-top: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
