/* =============================================
   HAPVIDA - Portal do Beneficiário
   Mobile-first CSS - Reforma Total
   ============================================= */

/* --- Variables --- */
:root {
  --blue: #0435AC;
  --blue-dark: #032A8A;
  --blue-light: #e8eef8;
  --dark: #1a1a1a;
  --text: #4a4a4a;
  --text-muted: #717171;
  --white: #ffffff;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --border: #e2e5e9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-h: 56px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
  color: var(--dark);
  line-height: 1.3;
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* --- Container --- */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 14px;
  border-radius: var(--radius-sm); border: 2px solid transparent;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap; text-align: center;
}

.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline-light { background: rgba(255,255,255,0.1); color: var(--white); border-color: rgba(255,255,255,0.4); }
.btn-outline-light:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.7); }

.btn-white { background: var(--white); color: var(--blue); border-color: var(--white); }
.btn-white:hover { background: #f0f0f0; }

.btn-ghost { background: transparent; color: #999; border-color: #555; }
.btn-ghost:hover { color: #fff; border-color: #999; }

/* =============================================
   HEADER
   ============================================= */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  height: var(--header-h); transition: box-shadow 0.3s ease;
}
.header.scrolled { box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo img { height: 30px; width: auto; }

/* Desktop nav */
.nav { display: none; align-items: center; gap: 4px; }
.nav a { padding: 6px 12px; font-size: 14px; font-weight: 500; color: var(--text); border-radius: 6px; transition: color 0.2s, background 0.2s; }
.nav a:hover { color: var(--blue); background: var(--blue-light); }

.nav-cta-btn {
  margin-left: 8px; padding: 8px 18px !important;
  background: var(--blue) !important; color: var(--white) !important;
  font-size: 13px !important; font-weight: 600 !important; border-radius: 7px !important;
}
.nav-cta-btn:hover { background: var(--blue-dark) !important; }

/* Hamburger */
.hamburger { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; z-index: 110; }
.hamburger span { position: absolute; display: block; width: 22px; height: 2px; background: var(--dark); border-radius: 2px; transition: transform 0.3s ease, opacity 0.2s ease; left: 50%; margin-left: -11px; }
.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 19px; }
.hamburger span:nth-child(3) { top: 26px; }
.hamburger.active span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* Mobile menu overlay */
.nav.mobile-open {
  display: flex; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh; height: 100dvh; background: #ffffff;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; z-index: 105; padding-top: var(--header-h);
}
.nav.mobile-open a { font-size: 20px; padding: 14px 24px; color: var(--dark); font-weight: 500; border-radius: 8px; transition: background 0.2s; }
.nav.mobile-open a:hover, .nav.mobile-open a:active { background: var(--blue-light); color: var(--blue); }
.nav.mobile-open .nav-cta-btn { margin-left: 0 !important; margin-top: 16px; padding: 16px 40px !important; font-size: 16px !important; border-radius: 10px !important; }

/* =============================================
   HERO
   ============================================= */
.hero { position: relative; min-height: 420px; display: flex; align-items: center; margin-top: var(--header-h); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; }

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(4, 53, 172, 0.92) 0%, rgba(3, 42, 138, 0.78) 50%, rgba(3, 42, 138, 0.50) 100%);
  z-index: 1;
}

.hero-content { position: relative; z-index: 2; padding-top: 48px; padding-bottom: 48px; color: var(--white); }
.hero-badge { display: inline-block; padding: 4px 12px; background: rgba(255,255,255,0.15); border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; margin-bottom: 16px; }
.hero h1 { font-size: 26px; color: var(--white); margin-bottom: 12px; line-height: 1.2; }
.hero-sub { font-size: 14px; line-height: 1.6; opacity: 0.9; margin-bottom: 24px; max-width: 480px; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; }
.hero-actions .btn { width: 100%; }

/* =============================================
   SECTIONS
   ============================================= */
.section { padding: 48px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 22px; text-align: center; margin-bottom: 32px; }

/* =============================================
   SERVICES
   ============================================= */
.services-grid { display: flex; flex-direction: column; gap: 12px; }

.service-card { display: block; padding: 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.2s, box-shadow 0.2s; }
.service-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }

.service-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; flex-shrink: 0; }
.service-icon svg { width: 22px; height: 22px; }

.icon-blue { background: var(--blue-light); color: var(--blue); }
.icon-green { background: #eef8ee; color: #2ecc71; }
.icon-orange { background: #fef3e2; color: #e67e22; }

.service-card h3 { font-size: 16px; margin-bottom: 4px; }
.service-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.service-link { font-size: 13px; color: var(--blue); font-weight: 600; }

/* =============================================
   STEPS
   ============================================= */
.steps { display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0 auto; }
.step { display: flex; align-items: flex-start; gap: 14px; }
.step-number { flex-shrink: 0; width: 34px; height: 34px; background: var(--blue); color: var(--white); font-weight: 700; font-size: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.step-text { display: flex; flex-direction: column; gap: 2px; }
.step-text strong { font-size: 15px; color: var(--dark); }
.step-text span { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* =============================================
   ABOUT
   ============================================= */
.about-grid { display: flex; flex-direction: column; gap: 28px; }
.about-image img { width: 100%; border-radius: var(--radius); object-fit: cover; max-height: 240px; }
.label-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--blue); margin-bottom: 6px; }
.about-text h2 { font-size: 22px; margin-bottom: 10px; }
.about-text > p { font-size: 14px; color: var(--text); margin-bottom: 16px; line-height: 1.65; }

.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--dark); font-weight: 500; }
.check-list li::before {
  content: ''; flex-shrink: 0; width: 18px; height: 18px; background: var(--blue); border-radius: 50%; display: inline-flex;
  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='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 10px;
}

/* =============================================
   STATS BAR
   ============================================= */
.stats-bar { padding: 32px 0; background: var(--blue); color: var(--white); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; text-align: center; }
.stat-number { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { display: block; font-size: 12px; opacity: 0.8; margin-top: 2px; }

/* =============================================
   FAQ
   ============================================= */
.faq-list { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.2s; }
.faq-item[open] { border-color: var(--blue); }

.faq-item summary { padding: 14px 16px; font-weight: 600; font-size: 14px; color: var(--dark); cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; user-select: none; -webkit-user-select: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; flex-shrink: 0; font-size: 18px; font-weight: 400; color: var(--text-muted); line-height: 1; transition: transform 0.3s ease; }
.faq-item[open] summary::after { content: '\2212'; color: var(--blue); transform: rotate(180deg); }

.faq-answer-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.faq-item[open] .faq-answer-wrap { grid-template-rows: 1fr; }
.faq-answer { overflow: hidden; min-height: 0; }
.faq-answer-inner { padding: 0 16px 14px; }
.faq-answer-inner p { font-size: 13px; color: var(--text); line-height: 1.65; }

/* =============================================
   CTA
   ============================================= */
.cta-section { background: var(--bg); }
.cta-box { background: var(--blue); border-radius: var(--radius); padding: 32px 20px; text-align: center; color: var(--white); }
.cta-box h2 { font-size: 20px; color: var(--white); margin-bottom: 8px; }
.cta-box > p { font-size: 14px; opacity: 0.9; margin-bottom: 20px; }

/* =============================================
   FOOTER
   ============================================= */
.footer { background: #111827; color: #9ca3af; padding-top: 36px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.footer-brand { text-align: center; }
.footer-logo { height: 32px; width: auto; margin: 0 auto 8px; }
.footer-brand p { font-size: 13px; line-height: 1.5; }
.footer-col { text-align: center; }
.footer-col h4 { color: var(--white); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.footer-col a { display: block; font-size: 13px; color: #9ca3af; padding: 3px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--white); }

.footer-company { padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.footer-company-inner { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.footer-company-inner span { font-size: 12px; color: #9ca3af; line-height: 1.5; }
.footer-company-inner span:first-child { color: var(--white); font-weight: 600; font-size: 13px; }

.footer-bottom { padding: 16px 0; text-align: center; }
.footer-bottom p { font-size: 12px; margin-bottom: 2px; }
.disclaimer { opacity: 0.5; font-size: 11px !important; }

/* =============================================
   WHATSAPP FLOAT
   ============================================= */
.whatsapp-float { position: fixed; bottom: 16px; right: 16px; width: 48px; height: 48px; background: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 90; box-shadow: 0 3px 12px rgba(37,211,102,0.35); transition: transform 0.2s; }
.whatsapp-float:hover { transform: scale(1.08); }

/* =============================================
   BACK TO TOP
   ============================================= */
.back-top { position: fixed; bottom: 72px; right: 16px; width: 36px; height: 36px; background: var(--white); color: var(--blue); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s, background 0.2s; z-index: 89; box-shadow: var(--shadow); }
.back-top.visible { opacity: 1; visibility: visible; }
.back-top:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* =============================================
   COOKIE BANNER
   ============================================= */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--dark); color: #ccc; padding: 12px 0; z-index: 200; transform: translateY(100%); transition: transform 0.35s ease; }
.cookie-banner.show { transform: translateY(0); }
.cookie-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.cookie-inner p { font-size: 12px; line-height: 1.5; margin: 0; }
.cookie-inner a { color: var(--blue); text-decoration: underline; }
.cookie-buttons { display: flex; gap: 8px; }

/* =============================================
   TABLET — min 600px
   ============================================= */
@media (min-width: 600px) {
  :root { --header-h: 60px; }
  .container { padding-left: 24px; padding-right: 24px; }
  .hero { min-height: 460px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .hero-actions { flex-direction: row; }
  .hero-actions .btn { width: auto; }
  .section { padding: 56px 0; }
  .section-title { font-size: 24px; margin-bottom: 36px; }
  .services-grid { flex-direction: row; gap: 16px; }
  .service-card { flex: 1; padding: 24px; }
  .about-grid { flex-direction: row; align-items: center; gap: 40px; }
  .about-image { flex: 0 0 45%; }
  .about-image img { max-height: 320px; }
  .about-text { flex: 1; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-number { font-size: 32px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; text-align: left; gap: 32px; }
  .footer-brand { text-align: left; }
  .footer-logo { margin: 0 0 8px; height: 34px; }
  .footer-col { text-align: left; }
  .cookie-inner { flex-direction: row; text-align: left; }
  .cookie-inner p { flex: 1; font-size: 13px; }
  .cta-box { padding: 40px 32px; }
  .cta-box h2 { font-size: 24px; }
}

/* =============================================
   DESKTOP — min 900px
   ============================================= */
@media (min-width: 900px) {
  :root { --header-h: 64px; }
  .container { padding-left: 32px; padding-right: 32px; }
  .nav { display: flex; }
  .hamburger { display: none; }
  .logo img { height: 34px; }
  .hero { min-height: 540px; }
  .hero-content { padding-top: 72px; padding-bottom: 72px; }
  .hero h1 { font-size: 40px; }
  .hero-sub { font-size: 16px; }
  .section { padding: 72px 0; }
  .section-title { font-size: 28px; margin-bottom: 44px; }
  .services-grid { gap: 20px; }
  .service-card { padding: 28px; }
  .service-card h3 { font-size: 17px; }
  .service-card p { font-size: 14px; }
  .about-text h2 { font-size: 26px; }
  .about-image img { max-height: 360px; }
  .stat-number { font-size: 36px; }
  .stat-label { font-size: 13px; }
  .cta-box { padding: 56px 48px; border-radius: 16px; }
  .cta-box h2 { font-size: 28px; }
  .cta-box > p { font-size: 16px; }
  .faq-item summary { padding: 16px 20px; font-size: 15px; }
  .faq-answer-inner { padding: 0 20px 16px; }
  .faq-answer-inner p { font-size: 14px; }
  .whatsapp-float { width: 52px; height: 52px; bottom: 20px; right: 20px; }
  .back-top { width: 40px; height: 40px; bottom: 80px; right: 20px; }
}
