/* =========================================================
   Sedwiis — design tokens + component styles
   Light corporate theme (matches the sedwis.com brief to mirror
   invoidea.com's structure/style: white base, blue accent, dark
   navy CTA/footer bands). Supersedes the earlier dark-theme tokens.
   ========================================================= */

:root {
  /* --- Typography --- */
  --font-family-primary: Mulish, sans-serif;
  --font-size-xs: 13px;
  --font-size-sm: 14px;
  --font-size-md: 15px;
  --font-size-lg: 16px; /* base */
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 26px;
  --font-size-5xl: 36px;
  --font-weight-base: 400;
  --font-weight-emphasis: 700;
  --line-height-base: 22.4px;

  /* --- Color: base (light) --- */
  --color-surface-base: #ffffff;
  --color-surface-raised: #f7f9fc;
  --color-surface-overlay: #eef2f8;
  --color-surface-dark: #0b1324;      /* topbar / CTA band / footer */
  --color-surface-dark-raised: #131d33;

  --color-text-primary: #16181d;      /* default body text */
  --color-text-secondary: #5b6472;    /* muted/secondary text */
  --color-text-tertiary: #0d6efd;     /* brand accent — links, CTAs */
  --color-text-inverse: #ffffff;      /* text on accent / dark surfaces */
  --color-text-inverse-muted: rgba(255, 255, 255, 0.68);

  --color-border-default: rgba(15, 23, 42, 0.10);
  --color-border-strong: rgba(15, 23, 42, 0.24);
  --color-border-inverse: rgba(255, 255, 255, 0.16);

  --color-focus-ring: #0d6efd;

  --color-state-hover: rgba(13, 110, 253, 0.05);
  --color-state-active: rgba(13, 110, 253, 0.10);
  --color-state-disabled-text: rgba(15, 23, 42, 0.35);
  --color-state-disabled-surface: rgba(15, 23, 42, 0.06);
  --color-state-error: #c0392b;
  --color-state-error-surface: rgba(192, 57, 43, 0.08);
  --color-state-success: #15803d;
  --color-state-success-surface: rgba(21, 128, 61, 0.08);

  /* --- Spacing --- */
  --space-1: 3.2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 11.2px;
  --space-7: 14px;
  --space-8: 16px;

  /* --- Radius / motion --- */
  --radius-xs: 7.13px;
  --radius-sm: 12px;
  --motion-instant: 150ms;
  --motion-fast: 300ms;
  --motion-normal: 800ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-instant: 0ms;
    --motion-fast: 0ms;
    --motion-normal: 0ms;
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-base);
  line-height: var(--line-height-base);
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-weight: var(--font-weight-emphasis); margin: 0 0 var(--space-6); line-height: 1.25; }
h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
p { margin: 0 0 var(--space-6); }
ul, ol { margin: 0; padding: 0; list-style: none; }
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-8);
}
.text-muted { color: var(--color-text-secondary); }
.text-center { text-align: center; }

/* ---------- Focus-visible (global) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space-8);
  top: -48px;
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  padding: var(--space-4) var(--space-7);
  border-radius: var(--radius-xs);
  z-index: 1000;
  transition: top var(--motion-instant) ease;
}
.skip-link:focus { top: var(--space-8); }

/* ---------- Links ---------- */
a {
  color: var(--color-text-tertiary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--motion-instant) ease;
}
a.link-standalone { text-decoration: none; }
a.link-standalone:hover { text-decoration: underline; }
a[aria-disabled="true"] {
  color: var(--color-state-disabled-text);
  text-decoration: none;
  pointer-events: none;
  cursor: not-allowed;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 44px;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-emphasis);
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--motion-instant) ease, border-color var(--motion-instant) ease, opacity var(--motion-instant) ease;
}
.btn-primary { background: var(--color-text-tertiary); color: var(--color-text-inverse); }
.btn-primary:hover { background: #3d84f5; }
.btn-primary:active { background: #0b5ed7; }

.btn-secondary { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-state-hover); }
.btn-secondary:active { background: var(--color-state-active); }

.btn-ghost { background: transparent; color: var(--color-text-tertiary); }
.btn-ghost:hover { background: var(--color-state-hover); }

.btn-destructive { background: var(--color-state-error); color: var(--color-text-inverse); }
.btn-destructive:hover { opacity: 0.88; }

.btn-on-dark { background: #ffffff; color: var(--color-text-tertiary); }
.btn-on-dark:hover { background: #e7edf7; }

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--color-state-disabled-surface);
  color: var(--color-state-disabled-text);
  border-color: transparent;
  cursor: not-allowed;
}
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: btn-spin 700ms linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--space-6); }
.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-emphasis);
  margin-bottom: var(--space-2);
}
.form-hint { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: var(--space-2); }
.form-control {
  width: 100%;
  min-height: 44px;
  padding: var(--space-4) var(--space-7);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: var(--font-size-md);
  transition: border-color var(--motion-instant) ease;
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-control::placeholder { color: var(--color-state-disabled-text); }
.form-control:hover { border-color: var(--color-border-strong); }
.form-control:disabled {
  background: var(--color-state-disabled-surface);
  color: var(--color-state-disabled-text);
  cursor: not-allowed;
}
.form-group.has-error .form-control { border-color: var(--color-state-error); }
.form-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-state-error);
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
}
.form-error::before { content: "!"; font-weight: 700; }

.alert {
  padding: var(--space-7);
  border-radius: var(--radius-xs);
  margin-bottom: var(--space-8);
  font-size: var(--font-size-md);
  border: 1px solid transparent;
}
.alert-success { background: var(--color-state-success-surface); color: var(--color-state-success); border-color: var(--color-state-success); }
.alert-error { background: var(--color-state-error-surface); color: var(--color-state-error); border-color: var(--color-state-error); }

.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-8);
}
a.card { display: block; text-decoration: none; color: inherit; transition: background-color var(--motion-instant) ease, border-color var(--motion-instant) ease, box-shadow var(--motion-instant) ease; }
a.card:hover { background: var(--color-surface-overlay); border-color: var(--color-border-strong); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
.card-title { font-size: var(--font-size-xl); margin-bottom: var(--space-4); }
.card-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  background: var(--color-state-hover);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-6);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-8);
}

/* ---------- Lists ---------- */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--color-border-default);
}
.list-item:last-child { border-bottom: none; }
.check-list li {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  color: var(--color-text-secondary);
}
.check-list li::before { content: "\2713"; color: var(--color-state-success); font-weight: 700; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse-muted);
  font-size: var(--font-size-xs);
  padding: var(--space-4) 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.topbar-contacts { display: flex; gap: var(--space-7); flex-wrap: wrap; }
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: #fff; }

/* ---------- Navigation ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--color-border-default);
}
.navbar-brand { font-size: var(--font-size-xl); font-weight: var(--font-weight-emphasis); color: var(--color-text-primary); text-decoration: none; }
.navbar-nav { display: flex; align-items: center; gap: var(--space-8); }
.navbar-nav a { color: var(--color-text-primary); text-decoration: none; font-size: var(--font-size-md); }
.navbar-nav a:hover, .navbar-nav a[aria-current="page"] { color: var(--color-text-tertiary); }
.navbar-nav a[aria-current="page"] { border-bottom: 2px solid var(--color-text-tertiary); padding-bottom: 2px; }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xs);
  color: var(--color-text-primary);
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-4);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse-muted);
  padding: calc(var(--space-8) * 3) 0 var(--space-8);
  margin-top: calc(var(--space-8) * 2);
}
.footer h4 { color: #fff; font-size: var(--font-size-md); margin-bottom: var(--space-6); }
.footer p { color: var(--color-text-inverse-muted); }
.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-8);
  margin-bottom: calc(var(--space-8) * 2);
}
.footer-columns a { color: var(--color-text-inverse-muted); text-decoration: none; display: block; margin-bottom: var(--space-5); }
.footer-columns a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid var(--color-border-inverse);
  padding-top: var(--space-7);
  font-size: var(--font-size-xs);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-bottom a { color: var(--color-text-inverse-muted); }
.footer-bottom a:hover { color: #fff; }

/* ---------- Hero / sections ---------- */
.hero { padding: calc(var(--space-8) * 3) 0 calc(var(--space-8) * 2); text-align: center; }
.hero .container { max-width: 780px; }
.hero p.lead { font-size: var(--font-size-xl); color: var(--color-text-secondary); }
.hero-actions { display: flex; gap: var(--space-7); justify-content: center; flex-wrap: wrap; margin-top: var(--space-8); }
section { padding: calc(var(--space-8) * 2.5) 0; }
section.section-alt { background: var(--color-surface-raised); }
.section-heading { max-width: 640px; margin-bottom: calc(var(--space-8) * 1.5); }
.section-heading.center { max-width: 640px; margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-emphasis);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-8);
  text-align: center;
}
.stat-number { font-size: var(--font-size-5xl); font-weight: var(--font-weight-emphasis); color: var(--color-text-tertiary); }
.stat-label { font-size: var(--font-size-sm); color: var(--color-text-secondary); margin-top: var(--space-2); }

/* ---------- Process steps ---------- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-8);
}
.process-step { text-align: center; }
.process-step .step-number {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  color: var(--color-text-inverse);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--font-weight-emphasis);
  margin: 0 auto var(--space-6);
}

/* ---------- Ratings / testimonials ---------- */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-8);
}
.rating-card { text-align: center; }
.rating-stars { color: #f5b301; font-size: var(--font-size-xl); letter-spacing: 3px; margin-bottom: var(--space-4); }
.rating-quote { color: var(--color-text-secondary); font-style: italic; }
.rating-name { font-weight: var(--font-weight-emphasis); margin-top: var(--space-4); }

/* ---------- Portfolio scroller ---------- */
.portfolio-scroll {
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-6);
  margin: 0 calc(var(--space-8) * -1);
  padding-inline: var(--space-8);
}
.portfolio-scroll .card { min-width: 280px; scroll-snap-align: start; }

/* ---------- FAQ (native <details>) ---------- */
.faq-item {
  border-bottom: 1px solid var(--color-border-default);
  padding: var(--space-7) 0;
}
.faq-item summary {
  cursor: pointer;
  font-weight: var(--font-weight-emphasis);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3em; color: var(--color-text-tertiary); flex-shrink: 0; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: var(--space-6); color: var(--color-text-secondary); }

/* ---------- CTA (dark band) ---------- */
.cta-dark {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
  text-align: center;
  padding: calc(var(--space-8) * 3) 0;
}
.cta-dark p { color: var(--color-text-inverse-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-surface-base);
    border-bottom: 1px solid var(--color-border-default);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: var(--space-8);
    gap: var(--space-6);
  }
  .navbar-nav.is-open { display: flex; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .navbar { position: relative; flex-wrap: wrap; }
  .topbar-contacts { display: none; }
  .hero { padding: calc(var(--space-8) * 2) 0; }
}

/* ---------- Admin ---------- */
.admin-shell { max-width: 1120px; margin-inline: auto; padding: var(--space-8); }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-8); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--color-border-default);
  font-size: var(--font-size-md);
}
.table th { color: var(--color-text-secondary); font-weight: var(--font-weight-emphasis); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-xs);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-emphasis);
}
.badge-new { background: var(--color-state-error-surface); color: var(--color-state-error); }
.badge-contacted { background: rgba(13, 110, 253, 0.10); color: var(--color-text-tertiary); }
.badge-closed { background: var(--color-state-success-surface); color: var(--color-state-success); }
.empty-state { text-align: center; padding: calc(var(--space-8) * 2); color: var(--color-text-secondary); }
.login-shell { max-width: 380px; margin: calc(var(--space-8) * 4) auto; padding: var(--space-8); }
