/* Barreto Advocacia - Institutional Styles */
:root {
  --primary: #022256;
  --primary-dark: #011a3d;
  --secondary: #0556A3;
  --accent: #1E8DE4;
  --accent-light: #4aa3eb;
  --white: #ffffff;
  --light: #f5f8fc;
  --gray-100: #eef2f7;
  --gray-200: #dce4ee;
  --gray-500: #6b7c93;
  --gray-700: #3a4a5c;
  --text: #1a2b3c;
  --success: #0d7a4f;
  --error: #b91c1c;
  --shadow: 0 4px 20px rgba(2, 34, 86, 0.08);
  --shadow-lg: 0 10px 40px rgba(2, 34, 86, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.25s ease;
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1140px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
  margin-bottom: 1rem;
  color: var(--gray-700);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(2, 34, 86, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

.nav a:hover,
.nav a.active {
  background: var(--light);
  color: var(--secondary);
}

.nav-cta {
  background: linear-gradient(135deg, var(--secondary), var(--accent)) !important;
  color: var(--white) !important;
  padding: 0.55rem 1.15rem !important;
  border-radius: 50px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(5, 86, 163, 0.3);
}

.nav-cta:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  color: var(--white) !important;
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--primary);
}

.menu-toggle svg {
  width: 28px;
  height: 28px;
}

/* Mobile menu */
@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 5rem 1.5rem 2rem;
    gap: 0.5rem;
    box-shadow: -8px 0 30px rgba(0,0,0,0.12);
    transition: right 0.3s ease;
    z-index: 999;
  }

  .nav.open {
    right: 0;
  }

  .nav a {
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    border-radius: var(--radius);
  }

  .nav-cta {
    text-align: center;
    margin-top: 0.5rem;
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 34, 86, 0.4);
    z-index: 998;
  }

  .nav-overlay.open {
    display: block;
  }
}

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--light) 0%, var(--white) 60%);
  padding: 3.5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 50%;
  height: 120%;
  background: linear-gradient(135deg, rgba(30, 141, 228, 0.08), rgba(5, 86, 163, 0.04));
  border-radius: 50%;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h1 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.hero-content .lead {
  font-size: 1.15rem;
  color: var(--gray-700);
  margin-bottom: 1.75rem;
  max-width: 34rem;
}

.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo img {
  max-width: 320px;
  width: 100%;
  filter: drop-shadow(0 12px 30px rgba(2, 34, 86, 0.15));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: var(--white);
  box-shadow: 0 6px 20px rgba(5, 86, 163, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(5, 86, 163, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--light);
}

.section-title {
  text-align: center;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  max-width: 36rem;
  margin: 0 auto 2.5rem;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: white;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Info boxes */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.info-item {
  background: var(--white);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
}

.info-item strong {
  display: block;
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.info-item span {
  color: var(--gray-700);
  font-size: 1.05rem;
}

/* Contact form */
.form-grid {
  display: grid;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 141, 228, 0.15);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.form-check input {
  margin-top: 0.25rem;
  accent-color: var(--secondary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  display: none;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: var(--error);
}

.form-group.has-error .form-error {
  display: block;
}

/* Contact info */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-info {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.contact-info h3 {
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-icon {
  width: 42px;
  height: 42px;
  background: var(--light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.contact-item a {
  color: var(--secondary);
  font-weight: 500;
}

.contact-item a:hover {
  color: var(--accent);
}

.map-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  aspect-ratio: 16 / 10;
  min-height: 280px;
}

.map-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

/* FAQ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.15rem 1.35rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--light);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--secondary);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-answer-inner {
  padding: 0 1.35rem 1.25rem;
  color: var(--gray-700);
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

/* Articles */
.article-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.article-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.article-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.article-card p {
  font-size: 0.95rem;
  flex: 1;
}

.article-card .read-more {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--secondary);
}

/* Page header */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.page-header h1 {
  color: var(--white);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: rgba(255,255,255,0.85);
  max-width: 32rem;
  margin: 0 auto;
}

/* Content page */
.content-page {
  padding: 3rem 0 4rem;
}

.content-block {
  max-width: 800px;
  margin: 0 auto;
}

.content-block h2 {
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.content-block h2:first-child {
  margin-top: 0;
}

.content-block ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.content-block ul li {
  margin-bottom: 0.4rem;
  color: var(--gray-700);
}

.content-block ol {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.content-block ol li {
  margin-bottom: 0.4rem;
  color: var(--gray-700);
}

/* Footer */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-logo img {
  height: 48px;
  width: auto;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.footer h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.75);
  padding: 0.3rem 0;
  font-size: 0.95rem;
}

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

.footer-contact p {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.footer-contact a {
  color: rgba(255,255,255,0.9);
}

.footer-contact a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

.footer-bottom a {
  color: rgba(255,255,255,0.7);
}

.footer-bottom a:hover {
  color: var(--white);
}

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

.cta-box {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cta-box h2 {
  color: var(--white);
  margin-bottom: 0.75rem;
}

.cta-box p {
  color: rgba(255,255,255,0.9);
  margin-bottom: 1.5rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-box .btn-primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: none;
}

.cta-box .btn-primary:hover {
  background: var(--light);
  color: var(--primary);
}

/* 404 */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page h1 {
  font-size: 5rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

/* Thank you */
.thank-you {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
}

.thank-you-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
}

.thank-you-icon svg {
  width: 40px;
  height: 40px;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: white;
  padding: 1.25rem;
  z-index: 2000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  display: none;
}

.cookie-banner.show {
  display: block;
}

.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-inner p {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  margin: 0;
  flex: 1;
  min-width: 220px;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-actions .btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
}

.btn-cookie-accept {
  background: var(--accent);
  color: white;
}

.btn-cookie-accept:hover {
  background: var(--accent-light);
  color: white;
}

.btn-cookie-reject {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
}

.btn-cookie-reject:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.25rem;
  z-index: 3000;
  border-radius: var(--radius);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* Focus visible */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive hero */
@media (max-width: 800px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content .lead {
    margin-left: auto;
    margin-right: auto;
  }

  .btn-group {
    justify-content: center;
  }

  .hero-logo {
    order: -1;
  }

  .hero-logo img {
    max-width: 220px;
  }
}

@media (max-width: 480px) {
  .logo img {
    height: 42px;
  }

  .section {
    padding: 3rem 0;
  }
}
