/* =====================================================================
   ETC 2027 — site.css  (loaded on EVERY page by layout/main.php)
   Header, footer, buttons, chat. Scoped so it never restyles the
   content of existing pages (that is content.css's job).
   ===================================================================== */
:root {
    --navy-900: #0b1730;
    --navy-800: #102244;
    --navy-700: #1a2c52;
    --navy-600: #2c3f65;
    --blue: #1a56db;
    --blue-dark: #1446b5;
    --silver: #c9d1de;
    --ink: #1b2333;
    --muted: #556070;
    --line: #dde3ec;
    --bg: #ffffff;
    --bg-alt: #f3f6fa;
    --wa: #128c4a;
    --wa-dark: #0e723c;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 34, 68, .06), 0 6px 20px rgba(16, 34, 68, .08);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font: 400 1rem/1.6 var(--font); color: var(--ink); background: var(--bg); }
.site-header, .site-header *, .site-footer, .site-footer *, .home, .home *, #ai-chat-box, #ai-chat-box *, .btn, .page-head, .page-head * { box-sizing: border-box; }
.site-header img, .site-footer img { max-width: 100%; height: auto; display: block; }
.site-header ul, .site-footer ul { margin: 0; padding: 0; }
.site-footer p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }
.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 3000; }
.skip:focus { left: .5rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 46px; padding: .6rem 1.25rem; border-radius: 999px;
    font-weight: 600; font-size: .98rem; text-decoration: none; line-height: 1.2;
    border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); color: #fff; }
.btn-light { background: #fff; color: var(--navy-800); }
.btn-light:hover { background: var(--silver); color: var(--navy-800); }
.btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .08); }
.btn-outline { border-color: var(--navy-800); color: var(--navy-800); }
.btn-outline:hover { background: var(--navy-800); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.btn-row.center { justify-content: center; }

.btn-secondary { background: var(--navy-800); color: #fff; }
.btn-secondary:hover { background: var(--blue); color: #fff; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--navy-800); color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand { flex-shrink: 0; display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { width: 52px; height: 52px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.25rem; letter-spacing: .08em; }
.brand-text small { white-space: nowrap; font-size: .72rem; color: var(--silver); letter-spacing: .03em; }

.nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 46px; height: 46px; padding: 11px; border: 0; border-radius: 10px;
    background: rgba(255, 255, 255, .1); cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; }

.site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--navy-800); padding: .5rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.site-nav.open { display: block; }
.site-nav ul { list-style: none; }
.site-nav li a {
    display: block; padding: .7rem .25rem; color: #fff; text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-nav li a:hover, .site-nav li a[aria-current] { color: var(--silver); }
.nav-cta { margin-top: 1rem; width: 100%; }

@media (min-width: 1100px) and (max-width: 1279px) {
    .site-nav { gap: .6rem !important; }
    .site-nav li a { padding: .5rem .4rem !important; font-size: .9rem !important; }
    .nav-cta { padding: .45rem .8rem !important; }
}
@media (min-width: 1100px) {
    .nav-toggle { display: none; }
    .site-nav {
        display: flex !important; position: static; padding: 0; border: 0;
        align-items: center; gap: 1rem; background: none;
    }
    .site-nav ul { display: flex; gap: .15rem; }
    .site-nav li a { white-space: nowrap; border: 0; padding: .5rem .55rem; font-size: .95rem; border-radius: 8px; }
    .site-nav li a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
    .nav-cta { white-space: nowrap; margin: 0; width: auto; min-height: 40px; padding: .45rem 1rem; font-size: .9rem; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #b8c4d8; font-size: .92rem; padding: 3rem 0 1.5rem; }
.site-footer a { color: #dbe3f1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(2, 1fr); }
.footer-brand { grid-column: 1 / -1; }
.footer-brand img { width: 64px; height: 64px; margin-bottom: .75rem; }
.footer-col h2 {
    line-height: 1.2; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #fff; margin-bottom: .8rem; }
.footer-col ul { list-style: none; display: grid; gap: .45rem; }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr repeat(4, 1fr); } .footer-brand { grid-column: auto; } }
.social { list-style: none; display: flex; gap: .5rem; }
.social a {
    display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.social a:hover { background: var(--blue); }
.social svg { width: 20px; height: 20px; fill: #fff; }
.copyright { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .82rem; }

/* ---------- Aria chat ---------- */
#ai-chat-toggle {
    position: fixed; right: 20px; bottom: 20px; z-index: 1500;
    width: 58px; height: 58px; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--navy-800); box-shadow: 0 6px 22px rgba(0, 0, 0, .3);
    display: flex; align-items: center; justify-content: center;
}
#ai-chat-toggle svg { width: 26px; height: 26px; fill: #fff; }
#ai-chat-toggle:hover { background: var(--blue); }
#ai-chat-box {
    position: fixed; right: 20px; bottom: 90px; z-index: 1500;
    width: min(370px, calc(100vw - 24px)); height: min(480px, calc(100vh - 120px));
    background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column;
}
#ai-chat-box[hidden] { display: none; }
@media (max-width: 480px) { #ai-chat-box { right: 12px; } }
#ai-chat-header {
    display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 16px;
    height: 58px; flex-shrink: 0; background: var(--navy-800); color: #fff;
}
#ai-chat-header-left { display: flex; align-items: center; gap: 10px; }
#ai-chat-avatar, .chat-icon {
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
#ai-chat-avatar { width: 34px; height: 34px; background: rgba(255, 255, 255, .15); font-size: 13px; }
#ai-chat-header-text { display: flex; flex-direction: column; }
#ai-chat-header-title { font-size: 14px; font-weight: 600; }
#ai-chat-header-subtitle { font-size: 11px; opacity: .75; }
#ai-chat-close-top {
    width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12);
    color: #fff; font-size: 20px; cursor: pointer;
}
#ai-chat-messages { flex: 1; overflow-y: auto; padding: 14px; background: #f6f8fb; font-size: 14px; }
.chat-msg-user, .chat-msg-ai { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.chat-msg-user { flex-direction: row-reverse; }
.chat-icon { width: 28px; height: 28px; font-size: 10px; margin-top: 2px; }
.chat-icon-ai { background: var(--navy-800); color: #fff; }
.chat-icon-user { background: #e0e4ea; color: #555; }
.chat-bubble { max-width: 80%; padding: 8px 13px; border-radius: 14px; line-height: 1.5; word-break: break-word; }
.chat-bubble-user { background: var(--navy-800); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-ai { background: #fff; border: 1px solid #e6e9ef; border-bottom-left-radius: 4px; }
.typing-indicator { display: flex; gap: 4px; padding: 4px 2px; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: #aab; animation: typingBounce 1.2s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
#ai-chat-input-row { display: flex; gap: 8px; padding: 10px 10px 10px 14px; border-top: 1px solid #eee; margin: 0; }
#ai-chat-input {
    flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid #dde1e8; border-radius: 22px;
    background: #f5f6f8; font: inherit; font-size: 14px; color: var(--ink);
}
#ai-chat-input:focus { border-color: var(--navy-800); background: #fff; outline: none; }
#ai-chat-send { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--navy-800); color: #fff; cursor: pointer; }
#ai-chat-send:hover { background: var(--blue); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
