/* ===== GLOBAL RESET & VARS ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ocean:  #021828;
  --deep:   #042C53;
  --mid:    #0C447C;
  --bright: #185FA5;
  --sky:    #378ADD;
  --aqua:   #1ECBE1;
  --foam:   #B5D4F4;
  --white:  #EEF6FF;
  --muted:  #7aaed4;
  --border: rgba(30,203,225,0.14);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--ocean);
  color: var(--white);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== NAVBAR ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 5vw;
  background: rgba(2,24,40,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30,203,225,0.1);
  transition: padding 0.3s;
}
nav.scrolled { padding: 12px 5vw; }

.logo {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(90deg, var(--aqua), var(--foam));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; text-decoration: none;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }
.brand-text { font-family: 'Fraunces', serif; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.5px; color: var(--white); line-height: 1.15; }
.brand-text small { display: block; font-size: 0.6rem; font-weight: 500; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { height: 36px; width: auto; }
.footer-brand span { font-family: 'Fraunces', serif; font-weight: 800; font-size: 1rem; color: var(--white); }

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.95rem; font-weight: 500; letter-spacing: 0.3px;
  transition: color 0.2s; position: relative; padding-bottom: 3px;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1.5px; background: var(--aqua);
  transition: width 0.25s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--aqua); }

.btn-login {
  font-family: 'Fraunces', serif; font-weight: 700;
  font-size: 0.9rem; letter-spacing: 0.5px;
  color: var(--ocean);
  background: linear-gradient(135deg, var(--aqua), var(--sky));
  border: none; padding: 10px 24px; border-radius: 50px;
  cursor: pointer; transition: opacity 0.2s, transform 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-login:hover { opacity: 0.85; transform: translateY(-1px); }

/* MOBILE NAV */
.hamburger { display: none; background: none; border: none; cursor: pointer; }
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--foam); margin: 5px 0; border-radius: 2px; transition: all 0.3s;
}
.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: rgba(2,24,40,0.97); backdrop-filter: blur(20px);
  padding: 24px 6vw; z-index: 998; border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; color: var(--muted); text-decoration: none;
  font-size: 1.1rem; padding: 14px 0;
  border-bottom: 1px solid rgba(30,203,225,0.08);
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--aqua); }

/* ===== WAVE DIVIDERS ===== */
.wave-divider { display: block; width: 100%; line-height: 0; }

/* ===== PAGE HERO (inner pages) ===== */
.page-hero {
  padding: 140px 6vw 80px;
  text-align: center;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(12,68,124,0.5), transparent 70%), var(--ocean);
  position: relative; overflow: hidden;
}
.page-hero canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.4; pointer-events: none;
}
.page-hero .eyebrow { position: relative; z-index: 2; }
.page-hero h1 { position: relative; z-index: 2; }
.page-hero p { position: relative; z-index: 2; }

/* ===== TYPOGRAPHY ===== */
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 3px;
  color: var(--aqua); text-transform: uppercase;
  display: block; margin-bottom: 12px;
}
h1.page-title {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; margin-bottom: 20px;
}
h1.page-title .hl {
  font-style: italic; font-weight: 500; font-variation-settings: 'opsz' 144;
  background: linear-gradient(100deg, var(--aqua) 10%, var(--foam) 55%, var(--aqua) 90%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-sub {
  font-family: 'Inter', sans-serif;
  color: var(--muted); font-size: 1.05rem;
  line-height: 1.75; max-width: 560px; margin: 0 auto;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 600; line-height: 1.18; letter-spacing: -0.005em; margin-bottom: 14px;
}
.section-sub { font-family: 'Inter', sans-serif; color: var(--muted); font-size: 1.02rem; line-height: 1.8; max-width: 540px; }

/* ===== BUTTONS ===== */
.btn-primary {
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 1rem;
  color: var(--ocean);
  background: linear-gradient(135deg, var(--aqua), var(--sky));
  border: none; padding: 15px 40px; border-radius: 50px;
  cursor: pointer; box-shadow: 0 0 36px rgba(30,203,225,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 55px rgba(30,203,225,0.5); }

.btn-ghost {
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.95rem;
  color: var(--foam); background: transparent;
  border: 1.5px solid rgba(181,212,244,0.3);
  padding: 14px 36px; border-radius: 50px;
  cursor: pointer; transition: border-color 0.25s, color 0.25s;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { border-color: var(--aqua); color: var(--aqua); }

/* ===== CARDS ===== */
.card {
  background: linear-gradient(140deg, rgba(12,68,124,0.3), rgba(4,44,83,0.55));
  border: 1px solid var(--border); border-radius: 18px;
  padding: 32px 26px; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-7px); border-color: rgba(30,203,225,0.45); box-shadow: 0 20px 50px rgba(4,44,83,0.55); }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--aqua), var(--bright));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 18px; flex-shrink: 0;
}
.card h3 { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.card p { font-size: 0.95rem; color: var(--muted); line-height: 1.7; }

/* ===== GRID LAYOUTS ===== */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

/* ===== SECTIONS ===== */
.section { padding: 90px 6vw; }
.section-dark { background: #031422; }
.section-mid  { background: linear-gradient(145deg, #031422, var(--deep)); }
.section-head { margin-bottom: 52px; }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== FOOTER ===== */
footer {
  background: #020f1c;
  border-top: 1px solid rgba(30,203,225,0.1);
  padding: 48px 6vw 28px;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 36px;
  margin-bottom: 40px;
}
.footer-col h5 {
  font-family: 'Fraunces', serif; font-size: 0.85rem; font-weight: 700;
  letter-spacing: 2px; color: var(--aqua); text-transform: uppercase; margin-bottom: 16px;
}
.footer-col a, .footer-col p {
  display: block; color: var(--muted); text-decoration: none;
  font-size: 0.95rem; line-height: 1.65; margin-bottom: 8px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(30,203,225,0.08);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 0.88rem; color: var(--muted); }

/* ===== FORM INPUTS ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.9rem; font-weight: 500;
  color: var(--muted); margin-bottom: 8px; letter-spacing: 0.3px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: rgba(12,68,124,0.2);
  border: 1px solid rgba(55,138,221,0.25);
  border-radius: 12px; padding: 14px 18px;
  color: var(--white); font-family: 'Inter', sans-serif; font-size: 1rem;
  outline: none; transition: border-color 0.25s, background 0.25s; 
  -webkit-appearance: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--aqua); background: rgba(12,68,124,0.35);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(122,174,212,0.55); }
.form-group textarea { resize: vertical; min-height: 130px; }

/* ===== STAT BOX ===== */
.stat-box {
  background: rgba(12,68,124,0.22);
  border: 1px solid rgba(55,138,221,0.2);
  border-radius: 16px; padding: 28px 22px; text-align: center;
}
.stat-num { font-family: 'Fraunces', serif; font-size: 2.6rem; font-weight: 800; color: var(--aqua); line-height: 1; }
.stat-label { color: var(--muted); font-size: 0.9rem; margin-top: 7px; line-height: 1.4; }

/* ===== TAG ===== */
.tag {
  background: rgba(12,68,124,0.35); border: 1px solid rgba(55,138,221,0.3);
  color: var(--foam); font-size: 0.88rem; padding: 7px 18px; border-radius: 30px; display: inline-block;
}

@media (max-width: 700px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .section { padding: 64px 6vw; }
  .page-hero { padding: 110px 6vw 60px; }
  .brand-text { font-size: 0.82rem; white-space: nowrap; }
  .brand-text small { font-size: 0.52rem; letter-spacing: 1px; }
  .brand img { height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== RAIN / WATER FALL EFFECT (entry) ===== */
#rain-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9000;
}

/* ===== AMBIENT BUBBLES (fundo do mar, persistente) ===== */
#bubble-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
  opacity: 0.5;
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.wa-float {
  position: fixed; bottom: 26px; right: 26px; z-index: 950;
  width: 64px; height: 64px; border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 0 rgba(37,211,102,0.6);
  animation: wa-pulse 2.6s infinite;
  transition: transform 0.2s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; }

.wa-mascot {
  position: fixed; bottom: 18px; right: 92px; z-index: 949;
  width: 60px; height: 74px;
  pointer-events: none;
  animation: mascot-bob 2.8s ease-in-out infinite;
}
.wa-mascot svg { width: 100%; height: 100%; }

@keyframes wa-pulse {
  0%   { box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 0 rgba(37,211,102,0.55); }
  70%  { box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 0 rgba(37,211,102,0); }
}
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}

@media (max-width: 700px) {
  .wa-float {
    width: 56px;
    height: 56px;
    bottom: 18px;
    right: 18px;
  }

  .wa-float svg {
    width: 28px;
    height: 28px;
  }

  /* Gotinha no celular: menor, aparecendo ao lado do WhatsApp */
  .wa-mascot {
    display: block;
    position: fixed;
    bottom: 16px;
    right: 74px;
    width: 42px;
    height: 52px;
    z-index: 949;
    pointer-events: none;
    animation: mascot-bob 2.8s ease-in-out infinite;
  }

  .wa-mascot svg {
    width: 100%;
    height: 100%;
  }
}

/* ===== WHY SECTION (importância da análise de água) ===== */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.why-card {
  background: linear-gradient(145deg, rgba(12,68,124,0.3), rgba(4,44,83,0.55));
  border: 1px solid var(--border); border-radius: 18px; padding: 30px 24px;
}
.why-card .num {
  font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 800;
  color: var(--aqua); margin-bottom: 10px; display: block;
}

/* ===== LEGISLATION TABLE (portfolio content) ===== */
.legis-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.legis-table tr { border-bottom: 1px solid rgba(30,203,225,0.12); }
.legis-table tr:last-child { border-bottom: none; }
.legis-table td { padding: 12px 14px; font-size: 0.93rem; color: var(--foam); }
.legis-table td:first-child { color: var(--aqua); font-weight: 700; width: 42px; font-family: 'Fraunces', serif; }

.cred-box {
  background: linear-gradient(145deg, rgba(12,68,124,0.3), rgba(4,44,83,0.55));
  border: 1px solid var(--border); border-radius: 18px; padding: 28px 26px;
}
.cred-box h4 { font-family:'Fraunces',serif; font-weight:700; font-size:1rem; color:var(--aqua); margin-bottom:14px; letter-spacing:0.5px; }

.data-table { width: 100%; }
.data-table tr { border-bottom: 1px solid rgba(30,203,225,0.1); }
.data-table tr:last-child { border-bottom: none; }
.data-table td { padding: 10px 4px; font-size: 0.93rem; }
.data-table td:first-child { color: var(--muted); width: 38%; }
.data-table td:last-child { color: var(--white); font-weight: 500; }

/* ===== LEGISLATION ACCORDION (clicável, com explicações) ===== */
.legis-accordion { display: flex; flex-direction: column; gap: 10px; }
.legis-item {
  background: linear-gradient(145deg, rgba(12,68,124,0.28), rgba(4,44,83,0.5));
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; transition: border-color 0.25s;
}
.legis-item.open { border-color: rgba(30,203,225,0.45); }
.legis-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; cursor: pointer; user-select: none;
}
.legis-num {
  font-family: 'Fraunces', serif; font-weight: 800; font-size: 0.93rem;
  color: var(--aqua); flex-shrink: 0; width: 26px;
}
.legis-title { flex: 1; font-size: 0.95rem; font-weight: 600; color: var(--white); line-height: 1.45; }
.legis-arrow { color: var(--aqua); font-size: 1.1rem; transition: transform 0.3s; flex-shrink: 0; }
.legis-item.open .legis-arrow { transform: rotate(45deg); }
.legis-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.legis-item.open .legis-body { max-height: 400px; }
.legis-body-inner { padding: 0 20px 20px 60px; font-size: 0.93rem; color: var(--muted); line-height: 1.72; }

/* =========================================================
   RESPONSIVO FINAL - Laboratorio WR
   Ajustes para celular, tablet e desktop sem quebrar o layout original
   ========================================================= */
img, svg, video, canvas { max-width: 100%; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
body { width: 100%; }
section, header, footer, nav, .section, .page-hero { max-width: 100%; }

nav { min-height: 72px; gap: 18px; }
nav .btn-login { white-space: nowrap; }
.mobile-menu { box-shadow: 0 20px 45px rgba(0,0,0,.35); }

.btn-primary, .btn-ghost, .btn-login, .filter-btn, .social-btn { text-align: center; }
.card, .why-card, .cred-box, .stat-box, .team-card, .value-card, .svc-detail-card, .price-card, .project-card, .contact-card, .login-card {
  overflow-wrap: anywhere;
}

.grid-2, .grid-3, .grid-4, .why-grid, .team-grid, .values-grid, .svc-detail-grid, .process-grid, .pricing-grid, .projects-grid {
  width: 100%;
}

.legis-table, .data-table { table-layout: fixed; }
.legis-table td, .data-table td { word-break: normal; overflow-wrap: anywhere; }

@media (max-width: 1024px) {
  nav { padding: 16px 4vw; }
  nav.scrolled { padding: 12px 4vw; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: .9rem; }
  .btn-login { padding: 10px 18px; font-size: .86rem; }
  .section { padding: 76px 5vw; }
  .page-hero { padding: 128px 5vw 72px; }
  .grid-2 { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 40px; }
}

@media (max-width: 820px) {
  .nav-links { display: none; }
  .hamburger { display: block; flex-shrink: 0; }
  nav { min-height: 66px; }
  .mobile-menu { top: 66px; max-height: calc(100vh - 66px); overflow-y: auto; }
  nav > .btn-login { display: none; }
  .brand { min-width: 0; }
  .brand-text { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-text small { font-size: .54rem; letter-spacing: 1px; }
  .brand img { height: 34px; flex-shrink: 0; }
  .page-hero { padding: 112px 6vw 58px; }
  h1.page-title { font-size: clamp(2.05rem, 11vw, 3.2rem); }
  .page-sub, .section-sub { font-size: .98rem; line-height: 1.68; }
  .section-title { font-size: clamp(1.55rem, 8vw, 2.25rem); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .legis-body-inner { padding-left: 20px; }
}

@media (max-width: 600px) {
  .section { padding: 56px 5vw; }
  .page-hero { padding: 100px 5vw 48px; }
  .eyebrow { font-size: .72rem; letter-spacing: 2px; }
  .card, .why-card, .cred-box, .contact-card, .login-card, .team-card, .value-card, .svc-detail-card, .price-card, .project-body {
    padding: 24px 18px;
    border-radius: 16px;
  }
  .grid-3, .grid-4, .why-grid, .team-grid, .values-grid, .svc-detail-grid, .process-grid, .pricing-grid, .projects-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .btn-primary, .btn-ghost { width: 100%; padding: 14px 18px; }
  .hero-cta, .social-login, .filters { flex-direction: column; align-items: stretch; }
  .filters { gap: 8px; }
  .filter-btn { width: 100%; }
  .info-item { gap: 12px; }
  .info-icon { width: 40px; height: 40px; }
  .social-row { justify-content: center; flex-wrap: wrap; }
  .stat-num { font-size: 2.15rem; }
  .certs-strip { flex-direction: column; }
  .cert-pill { width: 100%; }
  .mini-stats { gap: 18px; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand span { font-size: .95rem; }
  .form-options { flex-direction: column; align-items: flex-start; gap: 12px; }
  .form-group input, .form-group textarea, .form-group select { font-size: 16px; padding: 13px 15px; }
  .wa-float { bottom: 14px; right: 14px; }
}

@media (max-width: 380px) {
  nav { padding-left: 14px; padding-right: 14px; }
  .brand img { height: 30px; }
  .brand-text { font-size: .78rem; }
  .brand-text small { display: none; }
  h1.page-title { font-size: 1.95rem; }
  .page-sub { font-size: .93rem; }
  .card, .why-card, .cred-box, .contact-card, .login-card, .team-card, .value-card, .svc-detail-card, .price-card { padding: 22px 15px; }
}

/* ===== CORRECAO MENU MOBILE ===== */
@media (max-width: 820px) {
  .hamburger {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border-radius: 12px;
    border: 1px solid rgba(30,203,225,0.18);
    background: rgba(12,68,124,0.25);
    position: relative;
    z-index: 1001;
  }
  .hamburger span {
    margin: 0;
  }
  .hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .hamburger.open span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .mobile-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    z-index: 1000;
  }
  .mobile-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .mobile-menu a {
    font-size: 1.05rem;
    line-height: 1.35;
  }
}
