/*
  5 Horas — núcleo estético compartilhado
  Tokens, base, componentes comuns, header, footer e alternância de tema.
*/

:root {
  color-scheme: light;
  --fh-bg: #fafafa;
  --fh-surface: #ffffff;
  --fh-surface-soft: #f4f4f5;
  --fh-text: #18181b;
  --fh-muted: #52525b;
  --fh-subtle: #71717a;
  --fh-border: rgba(24, 24, 27, 0.12);
  --fh-primary: #14b8a6;
  --fh-primary-strong: #0f766e;
  --fh-primary-soft: #ccfbf1;
  --fh-accent: #14b8a6;
  --fh-accent-soft: #ccfbf1;
  --fh-line-professional: #2563eb;
  --fh-line-business: #14b8a6;
  --fh-line-personal: #8b5cf6;
  --fh-line-social: #f97316;
  --fh-line-public: #22c55e;
  --fh-app-eventos: #f97316;
  --fh-app-cerimonial: #d946ef;
  --fh-app-seguro: #6366f1;
  --fh-app-odonto: #0ea5e9;
  --fh-app-escola: #22c55e;
  --fh-app-pesquisa: #ef4444;
  --fh-dark-bg: #1c1c1c;
  --fh-dark-sidebar: #171717;
  --fh-dark-border: #2e2e2e;
  --fh-radius-sm: 12px;
  --fh-radius-md: 18px;
  --fh-radius-lg: 24px;
  --fh-radius-xl: 34px;
  --fh-radius-pill: 999px;
  --fh-shadow-sm: 0 8px 24px rgba(24, 24, 27, 0.06);
  --fh-shadow-md: 0 18px 48px rgba(24, 24, 27, 0.10);
  --fh-container: 1180px;
  --fh-section-y: clamp(64px, 9vw, 112px);
  --fh-gap: clamp(20px, 3vw, 32px);
  --fh-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fh-bg: #1c1c1c;
    --fh-surface: #171717;
    --fh-surface-soft: #202020;
    --fh-text: #f4f4f5;
    --fh-muted: #d4d4d8;
    --fh-subtle: #a1a1aa;
    --fh-border: #2e2e2e;
    --fh-primary: #14b8a6;
    --fh-primary-strong: #5eead4;
    --fh-primary-soft: rgba(20, 184, 166, 0.14);
    --fh-accent-soft: rgba(20, 184, 166, 0.14);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --fh-bg: #1c1c1c;
  --fh-surface: #171717;
  --fh-surface-soft: #202020;
  --fh-text: #f4f4f5;
  --fh-muted: #d4d4d8;
  --fh-subtle: #a1a1aa;
  --fh-border: #2e2e2e;
  --fh-primary: #14b8a6;
  --fh-primary-strong: #5eead4;
  --fh-primary-soft: rgba(20, 184, 166, 0.14);
  --fh-accent-soft: rgba(20, 184, 166, 0.14);
}

html[data-theme="light"] {
  color-scheme: light;
  --fh-bg: #fafafa;
  --fh-surface: #ffffff;
  --fh-surface-soft: #f4f4f5;
  --fh-text: #18181b;
  --fh-muted: #52525b;
  --fh-subtle: #71717a;
  --fh-border: rgba(24, 24, 27, 0.12);
  --fh-primary: #14b8a6;
  --fh-primary-strong: #0f766e;
  --fh-primary-soft: #ccfbf1;
  --fh-accent-soft: #ccfbf1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fh-font);
  color: var(--fh-text);
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.14), transparent 32rem),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 28rem),
    var(--fh-bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
svg { fill: none; }

.fh-page,
.fh-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.fh-container {
  width: min(100% - 32px, var(--fh-container));
  margin-inline: auto;
}

.fh-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--fh-bg) 84%, transparent);
  border-bottom: 1px solid var(--fh-border);
}

.fh-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.fh-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.24rem;
}

.fh-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #14b8a6);
  box-shadow: var(--fh-shadow-sm);
}

.fh-brand-text {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.fh-brand-text strong {
  font: inherit;
}

.fh-brand-text small {
  color: var(--fh-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
}

.fh-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--fh-radius-pill);
  border: 1px solid transparent;
  font-weight: 700;
  transition: all 160ms ease;
}

.fh-button:hover { transform: translateY(-1px); }

.fh-button-primary {
  background: var(--fh-primary);
  color: #042014;
  box-shadow: var(--fh-shadow-sm);
}

.fh-button-primary:hover {
  background: var(--fh-primary-strong);
  box-shadow: var(--fh-shadow-md);
}

.fh-button-ghost {
  background: color-mix(in srgb, var(--fh-surface) 70%, transparent);
  border-color: var(--fh-border);
  color: var(--fh-text);
}

.fh-panel,
.fh-hero-panel {
  position: relative;
  border-radius: var(--fh-radius-xl);
  background: color-mix(in srgb, var(--fh-surface) 86%, transparent);
  border: 1px solid var(--fh-border);
  box-shadow: var(--fh-shadow-md);
  backdrop-filter: blur(18px);
}

.fh-card {
  padding: clamp(22px, 3vw, 30px);
  border-radius: var(--fh-radius-lg);
  background: color-mix(in srgb, var(--fh-surface) 92%, transparent);
  border: 1px solid var(--fh-border);
  box-shadow: var(--fh-shadow-sm);
}

.fh-card h2,
.fh-card h3 {
  margin: 0;
  font-size: 1.24rem;
  letter-spacing: -0.035em;
}

.fh-card p {
  margin: 10px 0 0;
  color: var(--fh-muted);
}

.fh-card ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--fh-muted);
}

.fh-card li {
  position: relative;
  padding-left: 22px;
  margin-top: 8px;
}

.fh-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: var(--fh-radius-pill);
  background: var(--fh-primary);
}

.fh-theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--fh-radius-pill);
  border: 1px solid var(--fh-border);
  background: color-mix(in srgb, var(--fh-surface) 70%, transparent);
  color: var(--fh-text);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  transition: all 160ms ease;
}

.fh-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--fh-primary);
}

.fh-footer {
  padding: 42px 0;
  color: var(--fh-muted);
  border-top: 1px solid var(--fh-border);
}

.fh-footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.fh-footer-brand {
  display: grid;
  gap: 0.25rem;
}

.fh-footer-brand strong {
  color: var(--fh-text);
}

.fh-footer-brand span {
  display: block;
}

.fh-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.fh-footer-links a {
  font-weight: 700;
  transition: color 160ms ease;
}

.fh-footer-links a:hover {
  color: var(--fh-primary);
}

@media (max-width: 900px) {
  .fh-nav-links { display: none; }
}

@media (max-width: 640px) {
  .fh-container { width: min(100% - 22px, var(--fh-container)); }

  .fh-nav {
    min-height: 66px;
    gap: 10px;
  }

  .fh-brand {
    font-size: 1rem;
    gap: 10px;
  }

  .fh-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .fh-brand-text small {
    font-size: 0.68rem;
  }

  .fh-actions .fh-button-primary {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.84rem;
  }

  .fh-theme-toggle {
    width: 38px;
    height: 38px;
  }

  .fh-footer {
    padding: 34px 0;
  }

  .fh-footer-grid {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .fh-footer-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .fh-footer-links a {
    display: block;
    padding: 12px 0;
    border-top: 1px solid var(--fh-border);
  }
}
