/* File: maia-juridica/css/shared.css */
/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }

/* ===== VARIABLES (Maia ecosystem teal) ===== */
:root {
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --surface-2: #F4F7F9;
  --surface-3: #EAF1F4;
  --border: #DDE5EA;
  --border-fine: #ECF0F3;
  --ink: #0B2530;
  --ink-2: #16384A;
  --ink-3: #4A6072;
  --muted: #6B7E8C;
  --faint: #B8C5CD;

  /* ECOSYSTEM TEAL */
  --accent: #1B7A8C;
  --accent-soft: #3AA8BE;
  --accent-deep: #0D5C6D;
  --accent-wash: #E1F4F7;
  --accent-glow: rgba(27, 122, 140, 0.14);

  --whatsapp: #25D366;

  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;

  --shadow-sm: 0 1px 3px rgba(13,92,109,0.05), 0 1px 2px rgba(13,92,109,0.04);
  --shadow-md: 0 4px 16px rgba(13,92,109,0.06), 0 1px 4px rgba(13,92,109,0.04);
  --shadow-lg: 0 12px 40px rgba(13,92,109,0.10), 0 4px 12px rgba(13,92,109,0.05);

  --radius: 8px;
  --radius-lg: 14px;
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; max-width: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink-3);
  line-height: 1.65;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { overflow-x: hidden; max-width: 100%; }

::selection { background: var(--accent-glow); color: var(--ink); }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

/* ===== ICON HELPERS ===== */
.icon, .service-icon, .contact-icon, .method-num {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ===== NAV ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 2.5rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
}
nav.scrolled {
  border-bottom-color: var(--border-fine);
  box-shadow: 0 1px 12px rgba(13,92,109,0.06);
}

.nav-logo { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; flex-shrink: 0; }
.nav-logo-img { height: 42px; width: auto; object-fit: contain; }

.nav-wordmark { display: flex; flex-direction: column; }
.nav-wordmark-primary {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 400;
  color: var(--ink); letter-spacing: -0.02em; line-height: 1.15;
}
.nav-wordmark-primary em { font-style: italic; color: var(--accent); }
.nav-wordmark-sub {
  font-family: var(--mono); font-size: 0.58rem; font-weight: 400;
  color: var(--muted); letter-spacing: 0.08em; line-height: 1.2; margin-top: 0.15rem;
}

.nav-links { display: flex; align-items: center; gap: 0.15rem; list-style: none; }
.nav-links li a {
  display: block; padding: 0.5rem 0.85rem; color: var(--ink-3);
  text-decoration: none; font-size: 0.85rem; font-weight: 500;
  border-radius: 6px; transition: all 0.2s; white-space: nowrap;
}
.nav-links li a:hover { background: var(--surface-2); color: var(--ink); }

.nav-links li a.nav-cta {
  background: var(--accent); color: #fff; padding: 0.55rem 1rem;
  font-weight: 600; margin-left: 0.5rem;
}
.nav-links li a.nav-cta:hover { background: var(--accent-deep); color: #fff; }

.mobile-toggle {
  display: none; background: none; border: none; color: var(--ink-2);
  cursor: pointer; padding: 0.3rem; border-radius: 4px;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}
.mobile-toggle:hover { background: var(--surface-2); }

/* ===== SECTIONS ===== */
section { padding: 6rem 2.5rem; position: relative; overflow-x: hidden; }
.section-inner { max-width: 1100px; margin: 0 auto; }

.section-label {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  color: var(--accent); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .9rem;
}
.section-label::before { content: ''; width: 22px; height: 1.5px; background: var(--accent); }

.section-title {
  font-family: var(--serif); font-size: clamp(1.85rem, 3.6vw, 2.6rem); font-weight: 400;
  color: var(--ink); line-height: 1.18; margin-bottom: .8rem; letter-spacing: -0.02em;
}
.section-title em { color: var(--accent); font-style: italic; }

.section-sub {
  color: var(--ink-3); font-size: 1rem; font-weight: 400;
  max-width: 640px; line-height: 1.7; margin-bottom: 3rem;
}

/* ===== BUTTONS ===== */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.7rem; font-family: var(--sans); font-weight: 600; font-size: .9rem;
  text-decoration: none; cursor: pointer; border-radius: 8px;
  transition: all .25s cubic-bezier(.4,0,.2,1); letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover {
  background: var(--accent-deep); color: #fff;
  box-shadow: 0 8px 24px rgba(27,122,140,0.28); transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--ink-2); border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent); color: var(--accent); background: var(--surface);
}

/* ===== FOOTER ===== */
footer {
  background: var(--surface); padding: 0 2.5rem 2.5rem;
  border-top: 1px solid var(--border-fine); overflow: hidden;
}
.footer-logo-bar {
  display: flex; justify-content: center; padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border-fine); margin-bottom: 1.5rem;
}
.footer-logo-bar img {
  height: 56px; width: auto; object-fit: contain; opacity: 0.65;
  transition: opacity 0.3s;
}
.footer-logo-bar img:hover { opacity: 1; }

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1.2rem;
}
.footer-brand {
  font-size: .9rem; font-weight: 600; color: var(--ink);
  max-width: 100%;
}
.footer-brand small {
  display: block; font-family: var(--mono); font-size: .65rem;
  color: var(--muted); font-weight: 400; margin-top: .2rem;
}
.footer-links {
  display: flex; gap: 1.4rem; list-style: none; flex-wrap: wrap;
}
.footer-links a {
  display: inline-flex; align-items: center; min-height: 24px; padding: .15rem .1rem;
  color: var(--muted); text-decoration: none; font-size: .82rem; transition: color .2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  font-family: var(--mono); font-size: .65rem; color: var(--muted);
  width: 100%; text-align: center; margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border-fine);
}

/* ===== WHATSAPP FAB ===== */
.wa {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 58px; height: 58px; background: var(--whatsapp); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; z-index: 999;
  box-shadow: 0 6px 20px rgba(37,211,102,0.35);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  text-decoration: none; color: #fff;
}
.wa:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 10px 28px rgba(37,211,102,0.42);
  color: #fff;
}

/* ===== FOCUS ===== */
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ===== SCROLL REVEAL ===== */
.reveal { opacity: 1; transform: none; transition: opacity .65s cubic-bezier(.4,0,.2,1), transform .65s cubic-bezier(.4,0,.2,1); }
html:not(.js-ready) .reveal { opacity: 1 !important; transform: none !important; }
html.js-ready .reveal { opacity: 0; transform: translateY(18px); }
html.js-ready .reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE NAV ===== */
@media (max-width: 920px) {
  nav { padding: 0 1.25rem; }
  .nav-wordmark-sub { display: none; }
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-fine);
    padding: 0.75rem 1rem 1.25rem;
    gap: 0.25rem;
    transform: translateY(-110%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 12px 24px rgba(13,92,109,0.06);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li a {
    padding: 0.85rem 1rem; font-size: 0.95rem;
    border-radius: 8px;
  }
  .nav-links li a.nav-cta { margin-left: 0; margin-top: 0.5rem; text-align: center; }
  .mobile-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  section { padding: 4.5rem 1.25rem; }
  footer { padding: 0 1.25rem 2rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .wa { width: 52px; height: 52px; bottom: 1rem; right: 1rem; }
}
