/* ═══════════════════════════════════════
   REBHNI DESIGN SYSTEM v2
   Spec: docs/superpowers/specs/2026-03-26-website-redesign.md
   ═══════════════════════════════════════ */

/* --- 1. CSS Custom Properties --- */
:root {
    /* Colors */
    --charcoal-deep: #0E0E1A;
    --charcoal: #1A1A2E;
    --charcoal-mid: #16162A;
    --paper: #F8F7F4;
    --teal: #0D9488;
    --teal-light: #14B8A6;
    --teal-dark: #0A7A70;
    --teal-glow: rgba(13,148,136,0.4);
    --white: #FFFFFF;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --green: #22C55E;
    --amber: #F59E0B;
    --red: #EF4444;

    /* Typography */
    --font-heading: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
    --font-body: 'IBM Plex Sans Arabic', 'Cairo', -apple-system, sans-serif;

    /* Spacing */
    --section-pad: 120px;
    --section-pad-mobile: 72px;
    --container-max: 1280px;
    --container-pad: 32px;
    --container-pad-mobile: 20px;

    /* Z-index */
    --z-content: 1;
    --z-whatsapp: 998;
    --z-mobile-menu: 999;
    --z-navbar: 1000;
    --z-modal: 1100;
}

/* --- 2. Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--white);
    background: var(--charcoal-deep);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.25;
}

a { text-decoration: none; color: var(--teal-light); transition: all 0.3s ease; }
a:hover { color: var(--teal); text-decoration: underline; }

/* --- 3. Typography Scale --- */
.h1 { font-size: 4rem; font-weight: 900; }
.h2 { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.02em; }
.h3 { font-size: 1.3rem; font-weight: 700; }
.body-text { font-size: 1.05rem; color: var(--gray-400); }
.label-text { font-size: 0.82rem; font-weight: 600; }

/* --- 4. Layout --- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--container-pad); }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 var(--container-pad); }

.section { padding: var(--section-pad) 0; position: relative; }
.section-alt { background: var(--charcoal-mid); }
.section-light {
    background: var(--paper);
    color: var(--gray-700);
}
.section-light h1, .section-light h2, .section-light h3 { color: var(--charcoal); }
.section-light .body-text { color: var(--gray-700); }
.section-light a { color: var(--teal); }
.section-light a:hover { color: var(--teal-dark); }

.section-title { font-size: 2.8rem; font-weight: 800; margin-bottom: 16px; line-height: 1.2; color: var(--white); letter-spacing: -0.02em; }
.section-subtitle { font-size: 1.15rem; color: var(--gray-400); max-width: 560px; line-height: 1.85; }
.section-light .section-title { color: var(--charcoal); }
.section-light .section-subtitle { color: var(--gray-600); }

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* --- 5. Grid --- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* --- 6. Cards --- */
.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-4px);
}
.section-light .card {
    background: var(--white);
    border: 1px solid var(--gray-200);
}
.section-light .card:hover {
    border-color: var(--gray-300);
    transform: translateY(-4px);
}

/* --- 7. Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px 36px; border-radius: 14px; font-weight: 700; font-size: 1.05rem;
    border: 2px solid transparent; cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none; font-family: var(--font-heading);
    position: relative; letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(13,148,136,0.3); }

.btn-primary {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
    color: var(--white); border-color: transparent;
    box-shadow: 0 4px 24px var(--teal-glow);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 40px var(--teal-glow), 0 0 60px rgba(13,148,136,0.15);
    color: var(--white);
}
.btn-primary:active { transform: translateY(-1px); box-shadow: 0 2px 16px var(--teal-glow); }
.btn-primary:disabled, .btn-primary.disabled { opacity: 0.5; pointer-events: none; }

.btn-ghost {
    background: rgba(255,255,255,0.04); color: var(--gray-300);
    border-color: rgba(255,255,255,0.12);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--white); border-color: rgba(255,255,255,0.25); }
.btn-ghost:active { background: rgba(255,255,255,0.06); }

.btn-lg { padding: 20px 52px; font-size: 1.15rem; border-radius: 16px; }
.btn-sm { padding: 10px 24px; font-size: 0.9rem; border-radius: 10px; }
.btn-block { width: 100%; }

.btn-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-label { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- 8. Forms --- */
.form-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-input::placeholder { color: var(--gray-500); }
.form-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }
.form-input.error { border-color: var(--red); }
.form-error { color: var(--red); font-size: 0.82rem; margin-top: 6px; display: none; }
.form-input.error + .form-error { display: block; }
.form-success { color: var(--teal-light); font-size: 0.95rem; font-weight: 600; }

.section-light .form-input {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--charcoal);
}
.section-light .form-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }

/* --- 9. Tags --- */
.tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(13,148,136,0.1); border: 1px solid rgba(13,148,136,0.2);
    border-radius: 100px; padding: 8px 20px;
    font-size: 0.82rem; color: var(--teal-light); font-weight: 600;
}
.pulse-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--teal-light);
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.4; transform:scale(.8); } }

/* --- 10. Navbar --- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: var(--z-navbar);
    background: rgba(14,14,26,0.7);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.4s ease;
}
.navbar.scrolled { background: rgba(14,14,26,0.92); border-bottom-color: rgba(255,255,255,0.08); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.navbar-brand { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 900; color: var(--teal-light); text-decoration: none; }
.navbar-brand:hover { color: var(--white); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { color: var(--gray-400); font-weight: 500; font-size: 0.92rem; text-decoration: none; }
.nav-links a:hover { color: var(--white); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--gray-400); padding: 7px 14px; border-radius: 8px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.3s;
    font-family: var(--font-heading);
}
.lang-switch:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.hamburger { display: none; background: none; border: none; font-size: 1.4rem; color: var(--white); cursor: pointer; padding: 8px; }

.mobile-menu {
    display: none; position: fixed; top: 68px; left: 0; right: 0;
    z-index: var(--z-mobile-menu);
    background: rgba(14,14,26,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 16px 24px;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
}
.mobile-menu.open { display: block; max-height: 500px; }
.mobile-menu a { display: block; padding: 14px 0; color: var(--gray-300); font-weight: 500; border-bottom: 1px solid rgba(255,255,255,0.04); text-decoration: none; }
.mobile-menu .btn { width: 100%; margin-top: 10px; text-align: center; }

/* --- 11. Footer --- */
.footer { background: var(--charcoal-deep); color: var(--gray-500); padding: 80px 0 30px; border-top: 1px solid rgba(255,255,255,0.04); }
.footer h4 { color: var(--gray-300); font-size: 0.9rem; font-weight: 700; margin-bottom: 18px; text-transform: uppercase; letter-spacing: 0.08em; }
.footer a { color: var(--gray-500); font-size: 0.9rem; text-decoration: none; }
.footer a:hover { color: var(--teal-light); text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 48px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-brand p { font-size: 0.88rem; line-height: 1.8; margin-top: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.04); margin-top: 48px; padding-top: 24px; text-align: center; font-size: 0.82rem; color: var(--gray-600); }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
    font-size: 1rem; color: var(--gray-500); width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center;
}
.footer-social a:hover { color: var(--teal-light); background: rgba(13,148,136,0.12); }

/* --- 12. WhatsApp Float --- */
.whatsapp-float {
    position: fixed; bottom: 24px;
    z-index: var(--z-whatsapp);
    width: 56px; height: 56px; border-radius: 50%;
    background: #25D366; color: white; font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(37,211,102,0.35);
    transition: all 0.3s; text-decoration: none;
}
[dir="rtl"] .whatsapp-float { left: 24px; }
[dir="ltr"] .whatsapp-float { right: 24px; }
.whatsapp-float:hover { transform: scale(1.08); color: white; box-shadow: 0 6px 30px rgba(37,211,102,0.5); text-decoration: none; }

/* --- 13. Scroll Reveal --- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }
.reveal-d5 { transition-delay: .40s; }

/* --- 14. Responsive --- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --section-pad: 72px;
        --container-pad: 20px;
    }
    .h1 { font-size: 2.2rem; }
    .h2, .section-title { font-size: 1.8rem; }
    .h3 { font-size: 1.1rem; }
    .body-text { font-size: 0.95rem; }
    .label-text { font-size: 0.78rem; }

    .section { padding: var(--section-pad-mobile) 0; }
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }

    .nav-links, .nav-actions { display: none; }
    .hamburger { display: block; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .whatsapp-float { width: 50px; height: 50px; font-size: 1.3rem; bottom: 16px; }
    [dir="rtl"] .whatsapp-float { left: 16px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 1.7rem; }
}
