/**
 * Frontend design tokens — single source of truth for the public site.
 * Loaded from layout before page CSS; do not redefine these in feature stylesheets.
 */

@font-face {
    font-family: 'GE SS Two';
    src: url('../assets/fonts/GE_SS_Two_Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GE SS Two';
    src: url('../assets/fonts/GE_SS_Two_Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GE SS Two';
    src: url('../assets/fonts/GE_SS_Two_Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Typography */
    --font-sans: "Archivo", "GE SS Two", "Work Sans", system-ui,
        sans-serif;

    /* Brand */
    --color-primary: #337ab7;
    --color-primary-hover: #2563a8;

    /* Text */
    --color-text: #161616;
    --color-text-muted: #6b7280;
    /* Headings / high-contrast body (home sections) */
    --color-text-strong: #040516;

    /* Surfaces & chrome */
    --color-border: #e5e7eb;
    --color-surface: #ffffff;
    --color-bg-subtle: #f9fafb;

    /* Focus / accessibility */
    --color-focus-ring: #4a90e2;

    /* Radii (prefer these over magic numbers where possible) */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    /* Buttons & CTAs — consistent corners (not pills) */
    --radius-btn: 10px;

    /* Page shell — align with .frame (home) */
    --layout-max-width: 1639px;
    --layout-width: 90%;
    /* Bands like .courses-section sit slightly inside the shell */
    --layout-inner-max-width: 1480px;
}

html[lang="ar"] {
    --font-sans: "IBM Plex Sans Arabic", "GE SS Two", "Archivo", "Work Sans",
        system-ui, sans-serif;
    --font-arabic: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

/* Navbar — always IBM Plex Sans Arabic in Arabic (skip GE SS Two for menu text) */
html[lang="ar"] .frame-header,
html[lang="ar"] .frame-header .nav-link,
html[lang="ar"] .frame-header .dropdown-link,
html[lang="ar"] .frame-header .language-btn,
html[lang="ar"] .frame-header .language-dropdown-toggle,
html[lang="ar"] .frame-header .nav-auth-cta__btn,
html[lang="ar"] .frame-header .user-menu-btn,
html[lang="ar"] .frame-header .user-dropdown-link,
html[lang="ar"] .frame-header .site-logo-text,
body.lang-ar.dir-rtl .frame-header,
body.lang-ar.dir-rtl .frame-header .nav-link,
body.lang-ar.dir-rtl .frame-header .dropdown-link,
body.lang-ar.dir-rtl .frame-header .language-btn,
body.lang-ar.dir-rtl .frame-header .language-dropdown-toggle,
body.lang-ar.dir-rtl .frame-header .nav-auth-cta__btn,
body.lang-ar.dir-rtl .frame-header .user-menu-btn,
body.lang-ar.dir-rtl .frame-header .user-dropdown-link {
    font-family: var(--font-arabic);
}

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

body {
    margin: 0;
    font-family: var(--font-sans);
}

a {
    text-decoration: none;
}

/* Global button component (x-frontend.button) — aligned with sitewide CTA */
.fh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease,
        filter 0.22s ease;
    box-sizing: border-box;
    width: fit-content;
}

.fh-btn__text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fh-btn__leading {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.fh-btn__icon {
    flex-shrink: 0;
    transition: transform 0.22s ease;
}

html:not([dir="rtl"]) .fh-btn__icon {
    transform: rotate(180deg);
}

.fh-btn:hover .fh-btn__icon {
    transform: translateX(3px);
}

html:not([dir="rtl"]) .fh-btn:hover .fh-btn__icon {
    transform: rotate(180deg) translateX(-3px);
}

.fh-btn--primary {
    background: linear-gradient(135deg, #3f8dcb 0%, #2a6599 55%, #245a89 100%);
    color: #ffffff;
    box-shadow:
        0 10px 24px rgba(51, 122, 183, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.fh-btn--primary:hover {
    filter: brightness(1.04);
    transform: translateY(-2px);
    color: #ffffff;
    box-shadow:
        0 16px 32px rgba(51, 122, 183, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.fh-btn--secondary {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(51, 122, 183, 0.42);
    color: #2a6599;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.fh-btn--secondary:hover {
    background: #ffffff;
    border-color: #337ab7;
    transform: translateY(-2px);
    color: #1f5f9a;
    box-shadow: 0 12px 26px rgba(51, 122, 183, 0.16);
}

.fh-btn--lg {
    min-height: 54px;
    padding: 14px 24px;
    font-size: 1.05rem;
    border-radius: 13px;
}

.fh-btn:disabled,
.fh-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    filter: none;
}

/* Buttons & link-style CTAs — 10px radius sitewide */
.btn-primary,
.btn-secondary,
.btn-download,
.sign-in-btn,
.nav-auth-cta__btn,
.nav-auth-cta__btn--login,
.nav-auth-cta__btn--start,
.services-cta,
.tools-cta,
.courses-cta,
.tool-link,
.read-more-btn,
.contact-submit-btn,
.course-button,
.courses-nav-prev,
.courses-nav-next,
.lang-switcher-btn,
.enroll-button,
.course-assignment-submit,
.course-user-review__submit,
.filter-toolbar__clear,
.filter-toolbar__apply,
.page-shell button[type="submit"],
.auth-modal button[type="submit"],
.auth-modal__submit,
.auth-button,
.checkout-page button[type="submit"],
.floating-chat__send,
.fh-btn {
    border-radius: var(--radius-btn);
}

/* ── Sitewide section title (x-frontend.section-title) ── */
.fh-section-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: auto;
    max-width: 100%;
    margin: 0;
}

.fh-section-title-wrap--compact {
    gap: 8px;
}

.fh-section-title-wrap.fh-section-title--center {
    align-items: center;
    text-align: center;
    width: 100%;
}

.fh-section-title-wrap.fh-section-title--start {
    align-items: flex-start;
    text-align: start;
}

.fh-section-title__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 5px 11px;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2f6fad;
    background: rgba(51, 122, 183, 0.1);
    border: 1px solid rgba(51, 122, 183, 0.14);
}

.fh-section-title {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: clamp(1.55rem, 3.1vw, 2.4rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    color: #0b1220;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: inherit;
    column-gap: 0.3em;
    row-gap: 0.06em;
}

.fh-section-title-wrap.fh-section-title--center .fh-section-title {
    justify-content: center;
}

.fh-section-title__plain {
    color: #0f172a;
    font-weight: 650;
}

.fh-section-title__accent {
    position: relative;
    display: inline;
    font-weight: 800;
    color: #2a6599;
    background: linear-gradient(120deg, #3f8dcb 0%, #2563a8 55%, #1e4f86 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fh-section-title__accent::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.12em;
    height: 0.18em;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(51, 122, 183, 0.45) 0%, rgba(126, 200, 239, 0.15) 100%);
    opacity: 0.85;
    pointer-events: none;
}

/* Feedback title: no underline accent line */
.feedback-title .fh-section-title__accent::after {
    display: none;
}

.fh-section-title__mark {
    color: #337ab7;
    font-weight: 700;
    opacity: 0.85;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .fh-section-title__accent {
        color: #2a6599;
        -webkit-text-fill-color: unset;
        background: none;
    }
}

.fh-section-title__subtitle {
    margin: 0;
    max-width: 32rem;
    font-family: var(--font-sans);
    font-size: clamp(0.9rem, 1.35vw, 1rem);
    font-weight: 500;
    line-height: 1.5;
    color: #64748b;
}

html[dir="rtl"] .fh-section-title-wrap.fh-section-title--start,
.dir-rtl .fh-section-title-wrap.fh-section-title--start {
    align-items: flex-start;
    text-align: right;
}

html[dir="rtl"] .fh-section-title__accent::after,
.dir-rtl .fh-section-title__accent::after {
    background: linear-gradient(270deg, rgba(51, 122, 183, 0.45) 0%, rgba(126, 200, 239, 0.15) 100%);
}

/* ── Sitewide CTA (x-frontend.cta) ── */
.fh-cta {
    --fh-cta-pad-y: 12px;
    --fh-cta-pad-x: 22px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    border: 1.5px solid transparent;
    border-radius: 14px;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    width: fit-content;
    line-height: 1.2;
    isolation: isolate;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease,
        filter 0.22s ease;
}

.fh-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 20%,
        rgba(255, 255, 255, 0.22) 45%,
        transparent 70%
    );
    transform: translateX(-120%);
    transition: transform 0.55s ease;
    pointer-events: none;
    z-index: 0;
}

.fh-cta:hover::before {
    transform: translateX(120%);
}

.fh-cta__text,
.fh-cta__leading,
.fh-cta__lucide,
.fh-cta__arrow {
    position: relative;
    z-index: 1;
}

.fh-cta__text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fh-cta__leading,
.fh-cta__lucide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fh-cta__lucide {
    width: 1.1em;
    height: 1.1em;
}

.fh-cta__arrow {
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

html:not([dir="rtl"]) .fh-cta__arrow {
    transform: rotate(180deg);
}

.fh-cta:hover .fh-cta__arrow {
    transform: translateX(3px);
}

html:not([dir="rtl"]) .fh-cta:hover .fh-cta__arrow {
    transform: rotate(180deg) translateX(-3px);
}

.fh-cta--sm {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.8125rem;
    border-radius: 11px;
    gap: 8px;
}

.fh-cta--md {
    min-height: 48px;
    padding: var(--fh-cta-pad-y) var(--fh-cta-pad-x);
    font-size: 0.95rem;
}

.fh-cta--lg {
    min-height: 54px;
    padding: 14px 26px;
    font-size: 1.05rem;
    border-radius: 15px;
}

.fh-cta--primary {
    background: linear-gradient(135deg, #4696d4 0%, #2f74b0 48%, #1f5a8f 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 12px 28px rgba(51, 122, 183, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.fh-cta--primary:hover {
    transform: translateY(-2px);
    color: #ffffff;
    box-shadow:
        0 18px 36px rgba(51, 122, 183, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.05);
}

.fh-cta--primary:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.fh-cta--secondary {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(51, 122, 183, 0.42);
    color: #2a6599;
    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.fh-cta--secondary:hover {
    transform: translateY(-2px);
    background: #ffffff;
    border-color: #337ab7;
    color: #1f5f9a;
    box-shadow: 0 14px 28px rgba(51, 122, 183, 0.16);
}

.fh-cta--ghost {
    background: rgba(51, 122, 183, 0.08);
    color: #2f6fad;
    border-color: rgba(51, 122, 183, 0.1);
    box-shadow: none;
}

.fh-cta--ghost:hover {
    transform: translateY(-2px);
    background: rgba(51, 122, 183, 0.14);
    border-color: rgba(51, 122, 183, 0.18);
    color: #1e5a94;
}

.fh-cta:focus-visible {
    outline: 2px solid #337ab7;
    outline-offset: 3px;
}

.fh-cta:disabled,
.fh-cta[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    filter: none;
}

.fh-cta:disabled::before,
.fh-cta[aria-disabled="true"]::before {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .fh-cta,
    .fh-cta:hover,
    .fh-cta__arrow,
    .fh-cta:hover .fh-cta__arrow,
    .fh-cta::before,
    .fh-cta:hover::before {
        transition: none;
        transform: none;
    }

    html:not([dir="rtl"]) .fh-cta__arrow,
    html:not([dir="rtl"]) .fh-cta:hover .fh-cta__arrow {
        transform: rotate(180deg);
    }
}

/* Metronic student/admin panel (English): GE SS Two lacks Western digit glyphs */
html[lang="en"] body.admin-panel {
    --font-sans: Inter, Helvetica, "Segoe UI", Roboto, Arial, sans-serif;
    font-family: var(--font-sans);
}

html[lang="en"] body.admin-panel .fs-2hx,
html[lang="en"] body.admin-panel .numeral-latin,
html[lang="en"] body.admin-panel .fw-bold.fs-7,
html[lang="en"] body.admin-panel .badge {
    font-family: Inter, Helvetica, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
}

.numeral-latin {
    font-family: Inter, Helvetica, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
}
