/* ============================================================
   IRONCORE HUB — Shared Design System
   Drop this file into any IronCore property and link it.
   Pair with:
     1. Tailwind CDN + the config block below (in each HTML <head>)
     2. Google Fonts: DM Sans + Space Grotesk
     3. Lucide Icons CDN
   ============================================================

   TAILWIND CONFIG (paste inside a <script> after the Tailwind CDN tag):
   ─────────────────────────────────────────────────────────────
   tailwind.config = {
     theme: {
       extend: {
         colors: {
           background: '#fcfcfd',
           foreground: '#141a29',
           primary:   { DEFAULT: '#2563eb', foreground: '#ffffff' },
           secondary: { DEFAULT: '#f3f4f7', foreground: '#1a2038' },
           muted:     { DEFAULT: '#f3f4f7', foreground: '#5c6270' },
           accent:    { DEFAULT: '#07afda', foreground: '#ffffff' },
           card:      { DEFAULT: '#ffffff',  foreground: '#141a29' },
           border:    '#e5e7ec',
           input:     '#d5d9e2',
           ring:      '#2563eb',
           destructive: { DEFAULT: '#e83838', foreground: '#ffffff' },
         },
         fontFamily: {
           sans: ['"DM Sans"', 'ui-sans-serif', 'system-ui', '-apple-system', 'sans-serif'],
         },
         borderRadius: {
           '2xl': '1.4rem',
           '3xl': '1.9rem',
         },
         boxShadow: {
           xs:   '0 1px 0 0 rgb(0 0 0 / 0.08)',
           sm:   '0 1px 0 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08)',
           md:   '0 1px 0 0 rgb(0 0 0 / 0.08), 0 14px 45px -18px rgb(37 99 235 / 0.28)',
           lg:   '0 1px 0 0 rgb(0 0 0 / 0.08), 0 24px 70px -26px rgb(37 99 235 / 0.30)',
           xl:   '0 1px 0 0 rgb(0 0 0 / 0.08), 0 36px 90px -30px rgb(37 99 235 / 0.30)',
           '2xl':'0 55px 120px -35px rgb(37 99 235 / 0.30)',
         },
       },
     },
   }
   ─────────────────────────────────────────────────────────────

   FONT IMPORT (paste in <head> before this stylesheet):
   ─────────────────────────────────────────────────────────────
   <link rel="preconnect" href="https://fonts.googleapis.com" />
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
   <link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Space+Grotesk:wght@300..700&display=swap" rel="stylesheet" />
   ─────────────────────────────────────────────────────────────
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  --background:        220 33% 99%;
  --foreground:        224 35% 12%;
  --card:              0 0% 100%;
  --primary:           221 83% 53%;
  --primary-foreground:0 0% 100%;
  --secondary:         220 22% 96%;
  --muted:             220 22% 96%;
  --muted-foreground:  223 10% 40%;
  --accent:            192 94% 44%;
  --border:            220 14% 91%;
  --input:             220 16% 86%;
  --ring:              221 83% 53%;
  --radius:            0.9rem;
}

/* ============================================================
   2. BASE RESET & TYPOGRAPHY
   ============================================================ */
html {
  scroll-behavior: smooth;
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

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

section[id],
#contact-form,
#main-content {
  scroll-margin-top: 80px;
}

/* ============================================================
   3. ACCESSIBILITY — SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 1100;
  transform: translateY(-160%);
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--primary));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 0.6rem 0.95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 45px -18px hsl(var(--primary) / 0.28);
  transition: transform 160ms ease;
}
.skip-link:focus {
  transform: translateY(0.65rem);
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
#main-content:focus { outline: none; }

/* ============================================================
   4. DISPLAY FONT — Space Grotesk
   ============================================================ */
.gmn-display {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.04em;
}

/* ============================================================
   5. BACKGROUND DECORATORS
   ============================================================ */

/* Subtle gradient noise + colour washes — used behind hero / sections */
.gmn-noise {
  background-image:
    radial-gradient(circle at 10% 10%, hsl(var(--primary) / 0.12), transparent 45%),
    radial-gradient(circle at 90% 25%, hsl(var(--accent)  / 0.15), transparent 40%),
    radial-gradient(circle at 35% 90%, hsl(258 89% 65% / 0.12), transparent 42%),
    linear-gradient(to bottom, hsl(var(--background)), hsl(220 33% 97%));
}

/* Faint dot/line grid — use with mask so it fades at edges */
.gmn-grid {
  background-image:
    linear-gradient(to right,  hsl(var(--border)) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--border)) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(circle at 45% 20%, black 0%, transparent 65%);
          mask-image: radial-gradient(circle at 45% 20%, black 0%, transparent 65%);
  opacity: 0.45;
}

/* Coloured glow shadow — apply to cards you want to "float" */
.gmn-glow {
  box-shadow:
    0 0 0 1px hsl(var(--border) / 0.7),
    0 10px 60px -30px hsl(var(--primary) / 0.65),
    0 18px 80px -40px hsl(var(--accent)  / 0.45);
}

/* Decorative hero blob — position: absolute parent required */
.gmn-hero-blob {
  position: absolute;
  top: -140px;
  right: -120px;
  width: 520px;
  height: 520px;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 30% 30%, hsl(var(--accent)  / 0.38), transparent 60%),
    radial-gradient(circle at 60% 55%, hsl(var(--primary) / 0.38), transparent 55%),
    radial-gradient(circle at 40% 70%, hsl(258 89% 65% / 0.30), transparent 55%);
  filter: blur(16px);
  opacity: 0.9;
  transform: translateZ(0);
  pointer-events: none;
}

@media (max-width: 768px) {
  .gmn-hero-blob {
    width: 320px;
    height: 320px;
    top: -90px;
    right: -90px;
  }
}

/* ============================================================
   6. ENTRANCE ANIMATIONS
   ============================================================ */

/* Immediate fade-in on load */
.gmn-fade-in {
  animation: gmnFadeIn 700ms ease-out both;
  will-change: transform, opacity;
}
/* Slightly delayed version for a staggered hero */
.gmn-fade-in-delay {
  animation: gmnFadeIn 700ms ease-out 100ms both;
  will-change: transform, opacity;
}

@keyframes gmnFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll-triggered fade-in — JS adds .visible via IntersectionObserver */
.scroll-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.scroll-fade.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-fade.delay-1 { transition-delay: 0.1s; }
.scroll-fade.delay-2 { transition-delay: 0.2s; }
.scroll-fade.delay-3 { transition-delay: 0.3s; }
.scroll-fade.delay-4 { transition-delay: 0.4s; }
.scroll-fade.delay-5 { transition-delay: 0.5s; }

/* JS snippet to activate scroll-fade (paste before </body>):
   const obs = new IntersectionObserver(entries => {
     entries.forEach(e => { if (e.isIntersecting) e.target.classList.add('visible'); });
   }, { threshold: 0.1 });
   document.querySelectorAll('.scroll-fade').forEach(el => obs.observe(el));
*/

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
  outline: none;
}
.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* Variants */
.btn-default  { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-default:hover { background: hsl(221 83% 47%); }

.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.btn-secondary:hover { background: hsl(220 22% 92%); }

.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--muted)); }

.btn-outline { background: transparent; border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.btn-outline:hover { background: hsl(var(--muted)); }

/* Sizes */
.btn-lg   { padding: 0.75rem 1.5rem; font-size: 1rem;      border-radius: 0.9rem; }
.btn-sm   { padding: 0.375rem 0.625rem; font-size: 0.8125rem; border-radius: 0.55rem; }
.btn-icon { padding: 0; width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; }

/* ============================================================
   8. FORM CONTROLS
   ============================================================ */
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: 0.75rem;
  background: transparent;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  line-height: 1.5;
  display: block;
}
.form-input::placeholder,
.form-textarea::placeholder { color: hsl(var(--muted-foreground)); }
.form-input:focus,
.form-textarea:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}
.form-input:disabled,
.form-textarea:disabled { opacity: 0.6; cursor: not-allowed; }
.form-textarea { resize: vertical; min-height: 140px; }

/* Select elements inherit the same treatment */
.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: 0.75rem;
  background: hsl(var(--background));
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  line-height: 1.5;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6270' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
.form-select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

/* ============================================================
   9. SEPARATOR
   ============================================================ */
.separator {
  height: 1px;
  background: hsl(var(--border));
  border: none;
  width: 100%;
}

/* ============================================================
   10. FAQ ACCORDION
   ============================================================ */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.faq-answer.open { grid-template-rows: 1fr; }
.faq-answer-inner { overflow: hidden; }
.chevron-icon { transition: transform 0.2s ease; }
.faq-item.open .chevron-icon { transform: rotate(180deg); }

/* ============================================================
   11. SERVICE CARD HOVER
   ============================================================ */
.service-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 70px -26px hsl(var(--primary) / 0.25);
  background: hsl(var(--primary) / 0.05);
  border-color: hsl(var(--primary) / 0.3);
}
.service-card:hover .service-icon {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: scale(1.1);
}
.service-icon {
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.service-card:hover .service-title { color: hsl(var(--primary)); }

/* ============================================================
   12. TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  min-width: 280px;
  max-width: 380px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 24px 70px -26px hsl(var(--primary) / 0.30);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: toastIn 0.3s ease;
  will-change: transform, opacity;
  pointer-events: all;
}
.toast.destructive { border-color: hsl(0 84% 56% / 0.5); }
.toast-title { font-size: 0.875rem; font-weight: 600; color: hsl(var(--foreground)); }
.toast.destructive .toast-title { color: hsl(0 84% 56%); }
.toast-desc { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); line-height: 1.5; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Toast JS helper (paste before </body>):
   function showToast(title, desc, isError = false) {
     const c = document.getElementById('toast-container');
     const t = document.createElement('div');
     t.className = 'toast' + (isError ? ' destructive' : '');
     t.innerHTML = '<div class="toast-title">' + title + '</div><div class="toast-desc">' + desc + '</div>';
     c.appendChild(t);
     setTimeout(() => t.remove(), 5500);
   }
*/

/* ============================================================
   13. WHATSAPP FLOATING BUTTON
   ============================================================ */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9998;
  width: 3.25rem;
  height: 3.25rem;
  background: #25d366;
  color: #ffffff;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.6);
}
.whatsapp-float svg {
  width: 1.625rem;
  height: 1.625rem;
  fill: currentColor;
}
