/*
   Melvin Law Group Rebuild - Core Design System & Styling
   Palette: Alabaster / Deep Navy / Terracotta / Warm Brass
   Type: IBM Plex Serif (display) · IBM Plex Sans (body) · IBM Plex Mono (small caps/labels)
*/

/* --- CSS Variables & Design Tokens --- */
:root {
  --paper: #F9F8F6;
  --card: #FFFFFF;
  --ink: #1A2432;
  --body-c: #222222;
  --muted: #5A6B7C;
  --navy: #1A2432;
  --navy-deep: #0F1722;
  --accent: #1A56DB;
  --accent-hover: #1545AF;
  --accent-on-dark: #6EA0FF;
  --brass: #D4AF37;
  --line: #E2E0D9;
  --line-soft: #F0EFE9;

  --primary: #1A2432;
  --primary-light: #22314a;
  --primary-dark: #0F1722;
  --accent-light: #E9DDD4;
  --text-dark: #1F2937;
  --text-light: #F3F4F6;
  --text-muted: #6B7280;
  --bg-light: #F9FAFB;
  --bg-white: #FFFFFF;
  --border-color: rgba(26, 36, 50, 0.12);
  --success: #10B981;
  --error: #EF4444;

  --font-serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
  --display: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;

  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px -2px rgba(26, 36, 50, 0.08);
  --shadow-lg: 0 10px 30px -5px rgba(26, 36, 50, 0.12);

  --header-height: 80px;
}

/* --- Base Resets & Global Styles --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body-c);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* --- Bilingual Toggling System --- */
body.lang-en [lang="es"] {
  display: none !important;
}

body.lang-es [lang="en"] {
  display: none !important;
}

/* --- Typography & Headings --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 2.8vw, 2.4rem);
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--brass);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-dark);
  font-weight: 400;
}

p.lead {
  font-size: 1.125rem;
  color: var(--text-muted);
}

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

/* --- Structural Layouts --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5.25rem 0;
}

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

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem auto;
}

/* --- Buttons & Interactive Elements --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  font-family: var(--font-sans);
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-white);
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(197, 168, 128, 0.35);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent-on-dark);
  border-color: var(--accent-on-dark);
}

.btn-secondary:hover {
  background-color: rgba(197, 168, 128, 0.08);
  transform: translateY(-2px);
}

.btn-white {
  background-color: var(--bg-white);
  color: var(--primary);
  border-color: var(--bg-white);
}

.btn-white:hover {
  background-color: var(--bg-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 255, 255, 0.25);
}

/* --- Navigation Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(10, 30, 54, 0.1);
  transition: var(--transition);
}

.header.scrolled {
  height: 70px;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid rgba(10, 30, 54, 0.15);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
  border-radius: 18px;
  border: 1px solid rgba(10, 30, 54, 0.08);
  background: linear-gradient(135deg, rgba(10, 30, 54, 0.02), rgba(197, 168, 128, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: var(--transition);
}

.logo-wrapper:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(10, 30, 54, 0.08);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--bg-white);
  letter-spacing: 0.03em;
}

.logo-text span {
  color: var(--accent);
}

.logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
  padding: 0.25rem 0.45rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(197, 168, 128, 0.08));
  border: 1px solid rgba(10, 30, 54, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  position: relative;
  text-align: center;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-trigger::after {
  content: '\f282';
  font-family: 'bootstrap-icons';
  font-size: 0.72rem;
  transform: translateY(-1px);
}

.practice-areas-dropdown {
  position: absolute;
  top: calc(100% + 0.85rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 290px;
  background: rgba(9, 20, 34, 0.98);
  border: 1px solid rgba(197, 168, 128, 0.25);
  box-shadow: 0 18px 42px rgba(10, 20, 34, 0.22);
  border-radius: 14px;
  padding: 0.75rem 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 30;
}

/* Invisible bridge over the gap above the menu so moving the mouse from the
   trigger down into the menu doesn't cross a hole and trigger mouseleave. */
.practice-areas-dropdown::before {
  content: '';
  position: absolute;
  top: -0.85rem;
  left: 0;
  right: 0;
  height: 0.85rem;
}

.nav-dropdown.open .practice-areas-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.dropdown-link {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  padding: 0.72rem 1rem;
  border-left: 2px solid transparent;
  transition: var(--transition);
}

.dropdown-link:hover,
.dropdown-link:focus {
  background: rgba(197, 168, 128, 0.08);
  color: var(--bg-white);
  border-left-color: var(--accent);
  outline: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

/* Lang Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 36, 50, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(249,248,246,0.75));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.lang-btn {
  background: transparent;
  border: none;
  color: rgba(26, 36, 50, 0.72);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  min-width: 46px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn:hover {
  color: var(--primary);
  background: rgba(26, 36, 50, 0.03);
}

body.lang-en #lang-en-btn,
body.lang-es #lang-es-btn,
.lang-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--bg-white);
  box-shadow: 0 8px 20px rgba(26, 36, 50, 0.15);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.75rem;
  cursor: pointer;
}

/* --- Hero Banner Section --- */
.hero {
  position: relative;
  min-height: 80vh;
  padding-top: calc(var(--header-height) + 3rem);
  padding-bottom: 5rem;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(5, 14, 26, 0.96) 30%, rgba(16, 46, 74, 0.88) 100%);
  color: var(--text-light);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.55;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 10;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(243, 244, 246, 0.7);
  cursor: pointer;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--accent-on-dark);
}

.hero-title {
  color: var(--bg-white);
  font-size: 3.25rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.hero-desc {
  font-size: 1.2rem;
  color: rgba(243, 244, 246, 0.85);
  margin-bottom: 2.5rem;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
}

/* --- Practice Areas Grid --- */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem auto;
}

.section-subtitle {
  font-family: var(--font-serif);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.practice-card {
  background: linear-gradient(180deg, var(--bg-white), rgba(249, 250, 251, 0.96));
  border: 1px solid rgba(26, 36, 50, 0.08);
  padding: 2.5rem 1.75rem;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(26, 36, 50, 0.04);
  transition: var(--transition);
  text-align: center;
  height: 100%;
}

.practice-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(26, 36, 50, 0.08);
  border-color: rgba(197, 168, 128, 0.45);
}

.card-icon {
  width: 70px;
  height: 70px;
  background-color: rgba(197, 168, 128, 0.12);
  color: var(--accent-hover);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.75rem;
  transition: var(--transition);
}

.practice-card:hover .card-icon {
  background-color: var(--accent);
  color: var(--primary);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* --- Feature Callout (12 Years / Diplomat) --- */
.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.feature-img-wrapper {
  position: relative;
}

.feature-img {
  width: 100%;
  height: 540px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(26, 36, 50, 0.10);
}

.feature-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background-color: var(--primary);
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 1.5rem 2.5rem;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.badge-num {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.badge-lbl {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.feature-content {
  padding-right: 1rem;
}

.bullets-list {
  list-style: none;
  margin-top: 2rem;
}

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

.bullet-icon {
  color: var(--accent);
  font-size: 1.25rem;
  margin-top: 0.15rem;
}

.bullet-text h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.bullet-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* --- Professional Timeline --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 3rem auto 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 2.5rem;
}

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

.timeline-node {
  position: absolute;
  left: 11px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 3px solid var(--accent);
  z-index: 10;
  transition: var(--transition);
}

.timeline-item:hover .timeline-node {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.timeline-title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* --- Associations Showcase --- */
.assoc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 3rem;
}

.assoc-card {
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2.5rem;
  text-align: center;
  transition: var(--transition);
}

.assoc-card:hover {
  background-color: var(--bg-white);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.assoc-logo-placeholder {
  width: 90px;
  height: 90px;
  border: 2px dashed rgba(197, 168, 128, 0.4);
  border-radius: 50%;
  margin: 0 auto 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 2.5rem;
  transition: var(--transition);
}

.assoc-card:hover .assoc-logo-placeholder {
  border-style: solid;
  border-color: var(--accent);
  background-color: rgba(197, 168, 128, 0.08);
}

.assoc-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--primary);
}

/* --- Interactive Contact Form Section --- */
.contact-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
}

.form-wrapper {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  padding: 3rem;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-light);
  color: var(--text-dark);
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

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

/* Form validation styling */
.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

.error-message {
  display: none;
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 0.35rem;
  font-weight: 500;
}

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

/* Honeypot field: off-screen (not display:none, so more bots still fill it in) and
   removed from tab order / screen readers. */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-submit-error {
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 1rem;
  text-align: center;
}

/* Info Cards sidebar */
.info-card {
  background-color: var(--primary);
  color: var(--text-light);
  padding: 3rem;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, transparent 50%, rgba(197, 168, 128, 0.1) 50%);
}

.info-header h3 {
  color: var(--bg-white);
  border-bottom: 1px solid rgba(197, 168, 128, 0.2);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.info-block {
  margin-bottom: 2.25rem;
}

.info-block:last-child {
  margin-bottom: 0;
}

.info-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-on-dark);
  margin-bottom: 0.5rem;
}

.info-val {
  font-size: 1.1rem;
}

.info-val a:hover {
  color: var(--accent-on-dark);
}

.info-hours-list {
  list-style: none;
  margin-top: 0.5rem;
}

.info-hours-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  border-bottom: 1px dashed rgba(243, 244, 246, 0.15);
  padding: 0.35rem 0;
}

.info-hours-list li:last-child {
  border-bottom: none;
}

/* --- Office / Map Block --- */
.office-split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 3rem;
  align-items: stretch;
}

.map-embed {
  min-height: 380px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-light);
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
}

/* --- WhatsApp Float Widget --- */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: var(--bg-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: var(--transition);
}

.whatsapp-float:hover {
  transform: scale(1.1) rotate(5deg);
  background-color: #20BA5A;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid #25D366;
  animation: pulse-ring 1.8s infinite;
  z-index: -1;
  opacity: 0;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* --- CTA WhatsApp Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-light);
  text-align: center;
  padding: 4.5rem 0;
  border-top: 1px solid rgba(197, 168, 128, 0.2);
  position: relative;
}

.cta-banner-content {
  max-width: 650px;
  margin: 0 auto;
  z-index: 10;
  position: relative;
}

.cta-banner h2 {
  color: var(--bg-white);
  margin-bottom: 1rem;
}

.cta-banner h2::after {
  display: none;
}

.cta-banner p {
  color: rgba(243, 244, 246, 0.85);
  margin-bottom: 2rem;
}

.cta-banner .btn {
  background-color: #25D366;
  color: var(--primary);
  border-color: #25D366;
  gap: 0.5rem;
}

.cta-banner .btn:hover {
  background-color: #20BA5A;
  border-color: #20BA5A;
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
}

/* --- Footer --- */
.footer {
  background-color: var(--primary-dark);
  color: rgba(243, 244, 246, 0.6);
  padding: 4rem 0 2rem 0;
  border-top: 1px solid rgba(197, 168, 128, 0.1);
  font-size: 0.9rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(243, 244, 246, 0.1);
  padding-bottom: 2.5rem;
  margin-bottom: 2rem;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-nav-link {
  color: rgba(243, 244, 246, 0.75);
}

.footer-nav-link:hover {
  color: var(--accent-on-dark);
}

.footer-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(243, 244, 246, 0.75);
}

.footer-trust a {
  color: var(--accent);
  font-weight: 600;
}

.footer-trust a:hover {
  text-decoration: underline;
}

.footer-trust img {
  height: 44px;
  width: auto;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  color: #ffffff;
  font-size: 0.76rem;
  line-height: 1.7;
  opacity: 0.88;
  margin: 0;
}

/* --- Submission Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background-color: var(--bg-white);
  border: 2px solid var(--accent);
  padding: 3.5rem 2.5rem;
  border-radius: 4px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-icon {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.modal-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
  h1 {
    font-size: 2.25rem;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .feature-split {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .feature-img {
    height: 380px;
  }
  .assoc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Nav collapses to the drawer menu earlier than the rest of the mobile
   layout: at 768px there isn't enough room for all the nav items on one
   line (verified: they need ~1040px to avoid wrapping), so the drawer
   takes over sooner than other mobile-only adjustments below. */
@media (max-width: 1100px) {
  :root {
    --header-height: 70px;
  }

  .mobile-toggle {
    display: block;
    flex-shrink: 0;
  }

  /* Logo + language switcher have to share the header with the hamburger
     button once the drawer nav kicks in; at their desktop sizes the three
     together are wider than the available header space, which pushes the
     hamburger button off the right edge of the screen. Shrink them so
     everything fits inside the header's padding. */
  .nav-actions {
    gap: 0.5rem;
  }

  .logo-img {
    height: 40px;
    padding: 0.2rem 0.35rem;
  }

  .lang-switcher {
    padding: 0.18rem;
  }

  .lang-btn {
    padding: 0.4rem 0.5rem;
    min-width: 34px;
    font-size: 0.62rem;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    right: -110%;
    width: min(82vw, 320px);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(10, 30, 54, 0.98), rgba(10, 30, 54, 0.94));
    border-left: 1px solid rgba(197, 168, 128, 0.15);
    box-shadow: -18px 0 35px rgba(5, 14, 26, 0.28);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 2.25rem 1.5rem 2rem;
    gap: 1.1rem;
    transition: right 0.35s ease, opacity 0.2s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1100;
  }

  .nav-menu.active {
    right: 0;
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    display: block;
    width: 100%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--accent-on-dark);
  }

  /* Practice Areas becomes an inline expanding accordion in the drawer
     instead of the floating flyout used on desktop. */
  .nav-dropdown {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .dropdown-trigger::after {
    transition: transform 0.2s ease;
  }

  .nav-dropdown.open .dropdown-trigger::after {
    transform: rotate(180deg);
  }

  .practice-areas-dropdown {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-height: 0;
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .practice-areas-dropdown::before {
    content: none;
  }

  .nav-dropdown.open .practice-areas-dropdown {
    max-height: 700px;
    /* The base (desktop) rule for this same selector sets a translateX(-50%)
       flyout offset and wins on specificity over the plain .practice-areas-dropdown
       mobile reset above, so it has to be cancelled here too - otherwise opening
       the accordion on mobile shifts it off-screen and clips every label. */
    transform: none;
  }

  .dropdown-link {
    padding: 0.6rem 0.25rem 0.6rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 768px) {
  /* Hero section mobile */
  .hero {
    min-height: auto;
    padding: 7rem 0 4rem 0;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-desc {
    font-size: 1.05rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* Other sections */
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .assoc-grid {
    grid-template-columns: 1fr;
  }

  .contact-split {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .office-split {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .form-wrapper {
    padding: 2rem;
  }

  .footer-top {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-nav {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* --- Breadcrumbs --- */
.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(243, 244, 246, 0.7);
  margin-top: 1rem;
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: rgba(243, 244, 246, 0.4);
}

.breadcrumb a {
  color: rgba(243, 244, 246, 0.7);
}

.breadcrumb a:hover {
  color: var(--accent-on-dark);
}

.breadcrumb li:last-child {
  color: var(--accent-light);
}

/* --- Legal Content Prose (practice-area / FAQ body copy) --- */
.legal-content {
  max-width: 780px;
}

.legal-content h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
}

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

.legal-content ul {
  margin: 0 0 1.25rem 1.25rem;
  color: var(--text-dark);
}

.legal-content li {
  margin-bottom: 0.5rem;
}

/* --- Related Links --- */
.related-links {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.related-links a {
  color: var(--primary);
  font-weight: 600;
}

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

/* --- Practice Areas Hub Grid (reuses .practice-card) --- */
.grid-hub {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .grid-hub {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-hub {
    grid-template-columns: 1fr;
  }
}

.practice-card-link {
  display: block;
}

/* --- FAQ Accordion (native <details>) --- */
.faq-list {
  max-width: 820px;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
}

.faq-item summary {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: var(--transition);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin-top: 1rem;
  margin-bottom: 0;
  color: var(--text-muted);
}

/* --- Form Notice (contact page confidentiality warning) --- */
.form-notice {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* --- Why Rob Melvin? (credential blocks + row) --- */
.credential-block {
  padding-left: 1.5rem;
  border-left: 3px solid var(--brass);
}

.credential-block p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.credential-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.credential-row-item {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 1.25rem;
  position: relative;
}

.credential-row-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--border-color);
}

/* --- Find Your Immigration Path (guided orientation tool) --- */
#immigration-path {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

/* Screens toggle via [hidden]; this keeps any class-level display rule from overriding it. */
#immigration-path [hidden] {
  display: none !important;
}

#immigration-path button:focus-visible,
#immigration-path a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.path-step {
  max-width: 1000px;
  margin: 0 auto;
}

.path-step--narrow {
  max-width: 640px;
}

.path-step--results {
  max-width: 760px;
}

.path-intro {
  max-width: 700px;
  text-align: center;
}

.path-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 1rem 0 0;
}

.path-notice {
  max-width: 700px;
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.path-text-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.path-text-link:hover {
  color: var(--accent-hover);
}

.path-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.path-back,
.path-restart {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.path-back:hover,
.path-restart:hover {
  color: var(--accent);
}

.path-progress {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.path-question {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  text-align: center;
  margin-bottom: 1.75rem;
}

.path-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.path-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 56px;
  padding: 0.9rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.path-choice::after {
  content: '\f285';
  font-family: 'bootstrap-icons';
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
}

.path-choice:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.path-choice--described {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.path-choice-title {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.path-choice-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
}

.path-choice.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: #F3F7FE;
}

.path-continue-wrap,
.path-restart-wrap {
  text-align: center;
  margin-top: 1.5rem;
}

.path-result {
  scroll-margin-top: calc(var(--header-height) + 1rem);
  background: var(--card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--brass);
  border-radius: 4px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.path-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.path-result h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 1.25rem;
}

.path-urgent {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--brass);
  background: var(--bg-light);
}

.path-lead-in {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.path-fineprint {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.path-fineprint p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.path-fineprint p:last-child {
  margin-bottom: 0;
}

.path-context {
  margin-bottom: 1rem;
}

.path-context .path-text-link {
  margin-top: 0;
  font-size: 0.875rem;
}

.path-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.path-actions .btn {
  text-align: center;
}

/* .btn-secondary is styled for dark backgrounds; darken it for the white result card. */
.path-actions .btn-secondary {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 560px) {
  .path-result {
    padding: 1.75rem 1.25rem;
  }

  .path-result h3 {
    margin-bottom: 0.75rem;
  }

  .path-result > p {
    margin-bottom: 0.9rem;
  }

  .path-actions .btn {
    width: 100%;
  }
}

/* Smallest phones: the lead-in is the same generic line on every result, so it
   drops below the buttons to keep the consultation CTA on the first screen. */
@media (max-width: 400px) {
  .path-result {
    display: flex;
    flex-direction: column;
  }

  .path-result > .path-actions {
    margin-top: 0.5rem;
  }

  .path-result > .path-lead-in {
    order: 1;
    margin: 1rem 0 0;
  }

  .path-result > .path-fineprint {
    order: 2;
  }
}

/* --- Consultation popup (opened from a guide result) --- */
.consult-dialog {
  width: min(560px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  margin: auto; /* the global reset's margin: 0 would pin the popup to the top-left */
  padding: 0;
  border: none;
  border-top: 3px solid var(--brass);
  border-radius: 4px;
  background: var(--card);
  color: var(--body-c);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.consult-dialog::backdrop {
  background: rgba(5, 14, 26, 0.7);
}

body:has(.consult-dialog[open]) {
  overflow: hidden;
}

.consult-dialog-inner {
  position: relative;
  padding: 2.5rem;
}

.consult-dialog h2 {
  font-size: 1.75rem;
  margin-right: 2.5rem;
}

.consult-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.consult-close:hover {
  background: var(--bg-light);
  color: var(--ink);
}

.consult-dialog button:focus-visible,
.consult-dialog a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.consult-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.consult-alt {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
  text-align: center;
}

.consult-alt .bi-whatsapp {
  color: #25D366;
  margin-right: 0.25rem;
}

.consult-alt a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consult-thanks-view {
  padding: 1.5rem 0 0.5rem;
  text-align: center;
}

.consult-thanks-view .bi-check-circle-fill {
  display: block;
  font-size: 3.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.consult-thanks-view h2 {
  margin-right: 0;
}

.consult-thanks-view h2::after {
  display: none;
}

.consult-thanks-view p {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

@media (max-width: 560px) {
  .consult-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .consult-dialog-inner {
    padding: 3.5rem 1.25rem 2rem;
  }
}
