/* ========================================
   TAS SITE - SHARED DESIGN SYSTEM
   Loaded after Bootstrap, so these rules win over Bootstrap defaults.
   ======================================== */

/* ---------- 1. Design tokens ---------- */
:root {
    --brand-900: #14284f;
    --brand-800: #1e3c72;
    --brand-600: #2a5298;
    --brand-500: #3a68c4;
    --brand-100: #e8eefb;
    --brand-50: #f3f6fd;
    --accent-500: #f59e0b;
    --accent-600: #d97706;

    --ink-900: #111827;
    --ink-700: #374151;
    --ink-500: #5b6474;
    --line: #e3e8f0;
    --surface: #ffffff;
    --surface-alt: #f6f8fb;

    --gradient-brand: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-800) 45%, var(--brand-600) 100%);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
    --shadow-md: 0 6px 20px rgba(17, 24, 39, 0.07);
    --shadow-lg: 0 16px 40px rgba(20, 40, 79, 0.18);

    --site-gutter: 1rem;
    --section-space: 4.5rem;
    --tap-size: 44px;

    /* Bootstrap colour hooks, so .text-primary, .bg-primary and friends use the brand */
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 42, 82, 152;
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 42, 82, 152;
    --bs-link-hover-color: var(--brand-800);
    --bs-link-hover-color-rgb: 30, 60, 114;
    --bs-body-color: var(--ink-700);
    --bs-emphasis-color: var(--ink-900);
    --bs-secondary-color: var(--ink-500);
    --bs-border-radius: var(--radius-sm);
}

/* ---------- 2. Base typography ---------- */
html, body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", Tahoma, sans-serif;
}

body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-700);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Headings keep inheriting colour, so text on dark banners stays white */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    letter-spacing: -0.01em;
    line-height: 1.25;
}

body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6 {
    letter-spacing: 0;
}

a {
    color: var(--brand-600);
}

a:hover {
    color: var(--brand-800);
}

.small, small {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--ink-500) !important;
}

.lead {
    font-size: 1.15rem;
    line-height: 1.65;
}

:focus-visible {
    outline: 3px solid rgba(58, 104, 196, 0.45);
    outline-offset: 2px;
}

img {
    max-width: 100%;
}

/* ---------- 3. Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: var(--tap-size);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn .bi {
    margin: 0 !important;
}

.btn-sm {
    min-height: 40px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
}

.btn-lg {
    min-height: 52px;
    padding: 0.8rem 1.75rem;
    font-size: 1.05rem;
}

.btn-primary {
    --bs-btn-bg: var(--brand-600);
    --bs-btn-border-color: var(--brand-600);
    --bs-btn-hover-bg: var(--brand-800);
    --bs-btn-hover-border-color: var(--brand-800);
    --bs-btn-active-bg: var(--brand-900);
    --bs-btn-active-border-color: var(--brand-900);
    --bs-btn-disabled-bg: var(--brand-600);
    --bs-btn-disabled-border-color: var(--brand-600);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--brand-800);
    border-color: var(--brand-800);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-600);
    --bs-btn-border-color: #c9d5ee;
    --bs-btn-hover-bg: var(--brand-50);
    --bs-btn-hover-color: var(--brand-800);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-100);
    --bs-btn-active-color: var(--brand-800);
    --bs-btn-active-border-color: var(--brand-600);
    background: var(--surface);
}

.btn-light {
    --bs-btn-color: var(--brand-800);
    --bs-btn-hover-color: var(--brand-900);
    --bs-btn-bg: #fff;
    --bs-btn-hover-bg: #fff;
    --bs-btn-border-color: #fff;
    --bs-btn-hover-border-color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-outline-light {
    --bs-btn-border-color: rgba(255, 255, 255, 0.55);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.14);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #fff;
}

.btn-warning {
    --bs-btn-bg: var(--accent-500);
    --bs-btn-border-color: var(--accent-500);
    --bs-btn-hover-bg: var(--accent-600);
    --bs-btn-hover-border-color: var(--accent-600);
    --bs-btn-color: #1f1300;
    --bs-btn-hover-color: #1f1300;
}

.btn-primary:hover,
.btn-light:hover,
.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Gradient button used by the error screen */
.btn-primary-dark {
    background: var(--gradient-brand);
    color: #fff;
    border: none;
}

.btn-primary-dark:hover {
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary-dark:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- 4. Layout helpers ---------- */
.site-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Contact nests MainLayout inside EmptyLayout: the outer shell adds no extra space */
.main-content:has(> .content > .page) {
    padding-top: 0 !important;
}

.content.px-4:has(> .page) {
    padding: 0 !important;
    max-width: none;
}

.site-section {
    padding: var(--section-space) 0;
}

.section-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 2.75rem;
}

.section-head h2 {
    color: var(--ink-900);
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 0.6rem;
}

.section-head p {
    font-size: 1.1rem;
    color: var(--ink-500);
    margin: 0;
}

.section-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-600);
    margin-bottom: 0.6rem;
}

/* ---------- 5. Page hero (inner pages: Products, Contact) ---------- */
.page-hero {
    background: var(--gradient-brand);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 3.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.page-hero::after,
.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.12) 0%, transparent 45%), radial-gradient(circle at 10% 90%, rgba(58, 104, 196, 0.35) 0%, transparent 50%);
    pointer-events: none;
}

.page-hero > * {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    font-weight: 800;
    margin: 0 0 0.75rem;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
    max-width: 640px;
    margin: 0 auto;
}

/* ---------- 6. Home hero ---------- */
.home-hero {
    position: relative;
    overflow: hidden;
    background: var(--gradient-brand);
    color: #fff;
    border-radius: var(--radius-xl);
    margin: 1rem 0 0;
    box-shadow: var(--shadow-lg);
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
    padding: 4.5rem 4rem;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #dbe6ff;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.home-hero-title {
    color: #fff;
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    font-weight: 800;
    line-height: 1.12;
    margin: 0 0 1.1rem;
}

.home-hero-lead {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 620px;
    margin: 0 0 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    list-style: none;
    padding: 0 !important;
    margin: 2rem 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.hero-points li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-points .bi {
    color: #8fb3ff;
}

.home-hero-visual {
    display: flex;
    justify-content: center;
}

.hero-logo-card {
    width: min(100%, 300px);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.hero-logo-card img {
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: 22px;
    padding: 1.25rem;
}

/* ---------- 7. Cards ---------- */
.site-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cfd8e8;
}

/* Home product cards */
.home-product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    text-align: start;
}

.home-product-card .product-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.home-product-card .product-icon {
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.home-product-card .product-icon-wrapper.is-glyph {
    background: var(--brand-100);
    border-color: transparent;
    color: var(--brand-600);
    font-size: 1.75rem;
}

.home-product-card h3 {
    color: var(--ink-900);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.home-product-card p {
    color: var(--ink-500);
    font-size: 0.975rem;
    margin: 0 0 1.5rem;
    flex: 1;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.card-actions .btn {
    flex: 1 1 auto;
    white-space: nowrap;
}

/* Feature tiles (Why choose us, affiliate benefits) */
.feature-tile {
    height: 100%;
    padding: 1.75rem;
}

.feature-tile h3 {
    color: var(--ink-900);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.feature-tile p {
    color: var(--ink-500);
    margin: 0;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--brand-100);
    color: var(--brand-600);
    font-size: 1.5rem;
    margin-bottom: 1.1rem;
}

.feature-badge.is-accent {
    background: #fff4dc;
    color: var(--accent-600);
}

/* ---------- 8. Call to action band ---------- */
.cta-band {
    position: relative;
    overflow: hidden;
    background: var(--gradient-brand);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow-lg);
}

.cta-band h2 {
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 0 0 0.35rem;
}

.cta-band p {
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    font-size: 1.05rem;
}

.cta-band.is-centered {
    flex-direction: column;
    text-align: center;
}

/* ---------- 9. Site footer ---------- */
.site-footer {
    background: var(--brand-900);
    color: rgba(255, 255, 255, 0.75);
    padding: 2rem 0;
    margin-top: 3rem;
    font-size: 0.95rem;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-footer-brand img {
    height: 32px;
    width: auto;
    background: #fff;
    border-radius: 8px;
    padding: 3px;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin: 0;
    padding: 0 !important;
    list-style: none;
}

.site-footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-size);
    padding: 0 0.6rem;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}

.site-footer-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Icon circles in the home page product modals */
.modal .feature-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
}

/* ---------- 10. Phone and tablet ---------- */
@media (max-width: 991.98px) {
    .home-hero-inner {
        grid-template-columns: minmax(0, 1fr);
        padding: 3rem 2rem;
        gap: 2rem;
        text-align: center;
    }

    .home-hero-visual {
        order: -1;
    }

    .hero-logo-card {
        width: 160px;
        padding: 1rem;
        border-radius: 24px;
    }

    .hero-logo-card img {
        border-radius: 16px;
        padding: 0.75rem;
    }

    .home-hero-lead {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions,
    .hero-points {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    :root {
        --section-space: 3rem;
    }

    .site-container {
        padding-left: var(--site-gutter);
        padding-right: var(--site-gutter);
    }

    .lead {
        font-size: 1.05rem;
    }

    .page-hero {
        padding: 2.5rem 1.25rem;
        border-radius: var(--radius-lg);
    }

    .page-hero p {
        font-size: 1.05rem;
    }

    .home-hero {
        border-radius: var(--radius-lg);
    }

    .home-hero-inner {
        padding: 2.25rem 1.25rem;
    }

    .home-hero-lead {
        font-size: 1.05rem;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .section-head {
        margin-bottom: 2rem;
    }

    .section-head p {
        font-size: 1.025rem;
    }

    .home-product-card,
    .feature-tile {
        padding: 1.4rem;
    }

    .cta-band {
        padding: 2rem 1.25rem;
        border-radius: var(--radius-lg);
        flex-direction: column;
        text-align: center;
    }

    .cta-band .btn {
        width: 100%;
    }

    .site-footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .site-footer-brand {
        flex-direction: column;
    }

    .site-footer-links {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .site-card {
        transition: none;
    }

    .btn:hover,
    .site-card:hover {
        transform: none;
    }
}
