/* ==========================================================================
   Letrados.mx — grayscale editorial design system
   A restrained, authoritative law-firm theme layered over Bootstrap 5.
   Palette is strictly monochrome (charcoal → gray → paper); the only "color"
   is depth (shadow) and weight. Serif display + humanist sans for body.
   ========================================================================== */

:root {
  /* Ink / grayscale ramp */
  --ink:        #14161a;
  --ink-1:      #1c1f24;
  --ink-2:      #2a2e35;
  --graphite:   #3c414a;
  --slate:      #565c66;
  --steel:      #767d88;
  --muted:      #9aa0aa;
  --line:       #e4e7ec;
  --line-soft:  #eef0f3;
  --paper:      #ffffff;
  --paper-2:    #f6f7f9;
  --paper-3:    #eff1f4;

  /* Semantic */
  --bg:         var(--paper);
  --bg-alt:     var(--paper-2);
  --text:       var(--ink-1);
  --text-soft:  var(--slate);
  --heading:    var(--ink);

  /* Type */
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Rhythm */
  --radius:     4px;
  --radius-lg:  8px;
  --shadow-sm:  0 1px 2px rgba(20,22,26,.06), 0 1px 3px rgba(20,22,26,.04);
  --shadow:     0 2px 8px rgba(20,22,26,.06), 0 8px 24px rgba(20,22,26,.06);
  --shadow-lg:  0 10px 40px rgba(20,22,26,.14);
  --maxw:       1120px;

  /* Bootstrap variable overrides (monochrome) */
  --bs-primary: #14161a;
  --bs-primary-rgb: 20,22,26;
  --bs-link-color: #14161a;
  --bs-link-color-rgb: 20,22,26;
  --bs-link-hover-color: #565c66;
  --bs-body-color: #1c1f24;
  --bs-body-bg: #ffffff;
  --bs-border-color: #e4e7ec;
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; }

h1, h2, h3, h4, .display-serif {
  font-family: var(--font-serif);
  color: var(--heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.18;
}
h5, h6 { font-family: var(--font-sans); color: var(--heading); font-weight: 650; }

a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 2px; }
a:hover { color: var(--slate); }

.container { max-width: var(--maxw); }

::selection { background: var(--ink); color: #fff; }

/* Eyebrow / kicker */
.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  font-weight: 650;
  color: var(--steel);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--steel);
  display: inline-block;
}
.eyebrow.center::before { display: none; }

/* Section rhythm */
.section { padding: 4.5rem 0; }
.section-sm { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-ink { background: var(--ink); color: #cdd2da; }
.section-ink h1, .section-ink h2, .section-ink h3 { color: #fff; }

.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); margin: .6rem 0 .5rem; }
.section-head p { color: var(--text-soft); font-size: 1.05rem; margin: 0; }

.text-soft { color: var(--text-soft) !important; }
.text-ink  { color: var(--ink) !important; }
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar {
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: .6rem; padding-bottom: .6rem;
}
.navbar .container { max-width: var(--maxw); }
.navbar-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
  display: inline-flex;
  align-items: baseline;
  gap: .12rem;
}
.navbar-brand .brand-dot { color: var(--muted); font-weight: 400; }
.navbar .nav-link {
  color: var(--graphite) !important;
  font-weight: 500;
  font-size: .95rem;
  padding: .5rem .85rem !important;
  border-radius: var(--radius);
}
.navbar .nav-link:hover { color: var(--ink) !important; background: var(--paper-2); }
.navbar .nav-link.active { color: var(--ink) !important; font-weight: 650; }
.navbar .dropdown-menu {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: .4rem;
  margin-top: .5rem;
}
.navbar .dropdown-item {
  border-radius: var(--radius);
  font-size: .92rem;
  padding: .5rem .7rem;
  color: var(--graphite);
}
.navbar .dropdown-item:hover { background: var(--paper-2); color: var(--ink); }
.navbar .dropdown-item .di-sub { display:block; font-size:.78rem; color: var(--muted); }

/* Mega menu (practice areas) */
.mega-menu { min-width: min(680px, 92vw); }
.mega-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .1rem; }
@media (min-width: 992px){ .mega-grid { grid-template-columns: repeat(3, 1fr); } }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius);
  padding: .62rem 1.25rem;
  letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-lg { padding: .85rem 1.7rem; font-size: 1.02rem; }
.btn-primary, .btn-dark {
  --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: #000; --bs-btn-hover-border-color:#000;
  --bs-btn-active-bg:#000; --bs-btn-active-border-color:#000;
  --bs-btn-color:#fff; --bs-btn-hover-color:#fff;
  background: var(--ink); border-color: var(--ink); color:#fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.btn-primary:hover, .btn-dark:hover { background:#000; border-color:#000; color:#fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline-dark, .btn-outline-primary {
  --bs-btn-color: var(--ink); --bs-btn-border-color: var(--graphite);
  --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color:#fff;
  color: var(--ink); border-color: var(--graphite); background: transparent;
}
.btn-outline-dark:hover, .btn-outline-primary:hover { background: var(--ink); border-color: var(--ink); color:#fff; }
.btn-light, .btn-outline-light { border-radius: var(--radius); font-weight:600; }
.btn-warning { /* legacy hero button → neutralize to light-on-dark */
  --bs-btn-bg:#fff; --bs-btn-border-color:#fff; --bs-btn-color: var(--ink);
  --bs-btn-hover-bg:#eef0f3; --bs-btn-hover-border-color:#eef0f3; --bs-btn-hover-color: var(--ink);
  background:#fff; border-color:#fff; color: var(--ink);
}
.btn-warning:hover { background:#eef0f3; color: var(--ink); }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--graphite);
}
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--steel); }

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, #14161a 0%, #1c1f24 55%, #23272e 100%);
  color: #d7dbe1;
  overflow: hidden;
  padding: 4.5rem 0 3rem;
}
.hero::before { /* subtle engraved rule texture */
  content:""; position:absolute; inset:0;
  background-image: linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 46px 100%;
  opacity:.5; pointer-events:none;
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow { color: #9aa0aa; }
.hero .eyebrow::before { background:#5b626c; }
.hero h1 {
  color:#fff;
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  line-height: 1.08;
  margin: .9rem 0 1rem;
}
.hero .lead { color:#aeb4bd; font-size: 1.18rem; max-width: 33ch; }
.hero-trust {
  display:flex; flex-wrap:wrap; gap: .4rem 1.4rem;
  color:#8a9099; font-size:.85rem; margin-top: 1.6rem;
}
.hero-trust span { display:inline-flex; align-items:center; gap:.4rem; }
.hero-trust svg { flex:0 0 auto; }

/* Hero capture card — the front-and-center lead form */
.capture-card {
  background:#fff; color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.capture-card__head {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.capture-card__head h2 { font-size: 1.15rem; margin:0; }
.capture-card__head p { margin:.15rem 0 0; font-size:.85rem; color: var(--text-soft); }
.capture-card__body { padding: 1.5rem; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background:#fff; }
.card.shadow-sm, .card.shadow, .card.shadow-lg { box-shadow: var(--shadow-sm) !important; }

/* Practice-area tile */
.area-tile {
  display:flex; flex-direction:column; gap:.35rem;
  padding: 1.15rem 1.2rem;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:#fff;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.area-tile:hover { border-color: var(--ink); box-shadow: var(--shadow); transform: translateY(-2px); }
.area-tile__icon {
  width: 38px; height:38px; display:flex; align-items:center; justify-content:center;
  border: 1px solid var(--line); border-radius: var(--radius); font-size:1.2rem;
  color: var(--ink); background: var(--paper-2); margin-bottom:.3rem;
}
.area-tile__name { font-weight: 650; color: var(--ink); font-family: var(--font-sans); }
.area-tile__kw { font-size: .82rem; color: var(--muted); }
.area-tile__arrow { margin-top:auto; font-size:.8rem; color: var(--steel); font-weight:600; }

/* Step (how it works) */
.step { text-align:center; }
.step__n {
  width:46px; height:46px; margin:0 auto .8rem;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%; border:1px solid var(--ink); color:var(--ink);
  font-family: var(--font-serif); font-weight:700; font-size:1.2rem;
}
.step h3 { font-size:1.1rem; font-family: var(--font-sans); font-weight:650; }
.step p { color: var(--text-soft); font-size:.94rem; }
.step-line { position: relative; }

/* Lawyer card */
.lawyer-card {
  display:flex; gap: 1rem; padding:1.15rem; height:100%;
  border:1px solid var(--line); border-radius: var(--radius-lg); background:#fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lawyer-card:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.lawyer-card__avatar {
  flex:0 0 auto; width:56px; height:56px; border-radius:50%;
  background: var(--ink); color:#fff; display:flex; align-items:center; justify-content:center;
  font-family: var(--font-serif); font-weight:700; font-size:1.3rem; overflow:hidden;
}
.lawyer-card__avatar img { width:100%; height:100%; object-fit:cover; }
.lawyer-card__name { font-weight:650; color:var(--ink); font-family:var(--font-sans); }
.lawyer-card__meta { font-size:.85rem; color: var(--text-soft); }

/* Guide / article card */
.guide-card { height:100%; display:flex; flex-direction:column; }
.guide-card .card-body { display:flex; flex-direction:column; }
.guide-card h3 { font-size:1.12rem; margin-bottom:.4rem; }
.guide-card__excerpt { color: var(--text-soft); font-size:.92rem; flex:1; }
.guide-card__more { margin-top:.7rem; font-size:.85rem; font-weight:600; color:var(--ink); }

/* --------------------------------------------------------------------------
   Badges / pills
   -------------------------------------------------------------------------- */
.pill {
  display:inline-flex; align-items:center; gap:.35rem;
  font-size:.74rem; font-weight:600; letter-spacing:.02em;
  padding:.28rem .6rem; border-radius:100px;
  border:1px solid var(--line); color: var(--graphite); background: var(--paper-2);
}
.pill--verified { border-color:#c9ced6; color: var(--ink); background:#fff; }
.pill--verified svg { color: var(--ink); }
.pill--dark { background: var(--ink); color:#fff; border-color: var(--ink); }
.pill--ghost { background: transparent; }

.tag-row { display:flex; flex-wrap:wrap; gap:.4rem; }

/* --------------------------------------------------------------------------
   Trust / stats strip
   -------------------------------------------------------------------------- */
.stat-strip { display:grid; grid-template-columns: repeat(2,1fr); gap:1px; background: var(--line);
  border:1px solid var(--line); border-radius: var(--radius-lg); overflow:hidden; }
@media (min-width:768px){ .stat-strip { grid-template-columns: repeat(4,1fr); } }
.stat { background:#fff; padding:1.4rem 1.1rem; text-align:center; }
.stat__n { font-family: var(--font-serif); font-size:1.9rem; font-weight:700; color:var(--ink); line-height:1; }
.stat__l { font-size:.82rem; color: var(--text-soft); margin-top:.35rem; }

/* --------------------------------------------------------------------------
   FAQ accordion
   -------------------------------------------------------------------------- */
.faq { border-top:1px solid var(--line); }
.faq details { border-bottom:1px solid var(--line); }
.faq summary {
  list-style:none; cursor:pointer; padding:1.15rem .25rem;
  display:flex; justify-content:space-between; align-items:center; gap:1rem;
  font-weight:600; color:var(--ink); font-size:1.03rem;
}
.faq summary::-webkit-details-marker { display:none; }
.faq summary .faq-ico { flex:0 0 auto; width:22px; height:22px; position:relative; transition:transform .2s ease; }
.faq summary .faq-ico::before, .faq summary .faq-ico::after {
  content:""; position:absolute; background: var(--slate); border-radius:2px;
}
.faq summary .faq-ico::before { top:10px; left:3px; right:3px; height:2px; }
.faq summary .faq-ico::after  { left:10px; top:3px; bottom:3px; width:2px; transition:opacity .2s ease; }
.faq details[open] summary .faq-ico::after { opacity:0; }
.faq details[open] summary { color:var(--ink); }
.faq__a { padding:0 .25rem 1.25rem; color: var(--text-soft); max-width: 72ch; }
.faq__a p:last-child { margin-bottom:0; }

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.crumbs { font-size:.82rem; color: var(--muted); padding: 1.2rem 0 .2rem; }
.crumbs a { color: var(--steel); text-decoration:none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { margin:0 .5rem; color: var(--line); }
.prose .crumbs a, .crumbs a { text-decoration: none; }

/* --------------------------------------------------------------------------
   Prose (info pages, guides)
   -------------------------------------------------------------------------- */
.prose { max-width: 72ch; font-size: 1.06rem; color: var(--ink-1); }
.prose.wide { max-width: 78ch; }
.prose h2 { font-size:1.6rem; margin: 2.2rem 0 .8rem; }
.prose h3 { font-size:1.25rem; margin: 1.8rem 0 .6rem; }
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--steel); }
.prose a:hover { text-decoration-color: var(--ink); }
/* Buttons inside prose must keep their own text colour, not the prose link
   colour (was dark-on-dark → invisible text on .btn-primary, e.g. the CV CTA). */
.prose a.btn { text-decoration: none; }
.prose a.btn-primary, .prose a.btn-dark { color: #fff; }
.prose a.btn-warning { color: var(--ink); }
.prose a.btn-outline-dark, .prose a.btn-outline-light { text-decoration: none; }
.prose blockquote {
  margin: 1.6rem 0; padding: .4rem 0 .4rem 1.3rem;
  border-left: 3px solid var(--ink); color: var(--slate); font-style: italic;
}
.prose strong { color: var(--ink); }
.prose table { width:100%; border-collapse: collapse; margin: 1.4rem 0; font-size:.96rem; }
.prose th, .prose td { border:1px solid var(--line); padding:.65rem .8rem; text-align:left; }
.prose th { background: var(--paper-2); font-weight:650; }

.lead-paragraph { font-size:1.18rem; line-height:1.6; color: var(--slate); max-width: 66ch; }

/* Table of contents / aside */
.aside-card { border:1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2); padding:1.3rem; }
.aside-card h4 { font-size:.85rem; text-transform:uppercase; letter-spacing:.1em; color: var(--steel); margin-bottom:.7rem; }

/* Meta byline (guides/authors) */
.byline { display:flex; align-items:center; gap:.7rem; color: var(--text-soft); font-size:.9rem; }
.byline__avatar { width:38px; height:38px; border-radius:50%; background:var(--ink); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-family:var(--font-serif); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label { font-weight:600; font-size:.88rem; color: var(--graphite); margin-bottom:.3rem; }
.form-control, .form-select {
  border:1px solid var(--line); border-radius: var(--radius); padding:.62rem .8rem;
  color: var(--ink); background:#fff; font-size:.97rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,22,26,.10);
}
.form-control::placeholder { color: var(--muted); }
.form-text { color: var(--muted); font-size:.8rem; }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: var(--ink); color:#cfd4db; border-radius: var(--radius-lg);
  padding: 2.6rem 2rem; text-align:center; position:relative; overflow:hidden;
}
.cta-band h2 { color:#fff; font-size: clamp(1.5rem,3vw,2rem); margin-bottom:.6rem; }
.cta-band p { color:#aeb4bd; max-width: 52ch; margin:0 auto 1.4rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background:#101215; color:#9aa0aa; padding: 3.5rem 0 1.5rem; margin-top:auto; }
.site-footer a:not(.btn) { color:#c2c7cf; text-decoration:none; font-size:.9rem; }
.site-footer a:not(.btn):hover { color:#fff; }
/* the footer CTA is a button — keep readable in both states (was white-on-white on hover) */
.site-footer a.btn-outline-light { color:#fff; border-color:#5b626c; }
.site-footer a.btn-outline-light:hover { color:var(--ink); background:#fff; border-color:#fff; }
.site-footer h5 {
  color:#fff; font-family:var(--font-sans); font-size:.78rem; text-transform:uppercase;
  letter-spacing:.12em; margin-bottom:1rem; font-weight:650;
}
.site-footer .foot-brand { font-family:var(--font-serif); font-size:1.35rem; color:#fff; font-weight:700; }
.site-footer .foot-brand .brand-dot { color:#767d88; }
.site-footer li { margin-bottom:.55rem; list-style:none; }
.site-footer ul { padding:0; margin:0; }
.footer-bottom { border-top:1px solid #23272e; margin-top:2.5rem; padding-top:1.5rem; font-size:.82rem; color:#767d88; }
.footer-bottom a { color:#9aa0aa; font-size:.82rem; }
.footer-disclaimer { font-size:.78rem; color:#5b626c; max-width: 70ch; margin-top:.6rem; line-height:1.55; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.hidden { display:none !important; }
.divider-label { display:flex; align-items:center; gap:1rem; color:var(--muted); font-size:.8rem; text-transform:uppercase; letter-spacing:.1em; }
.divider-label::before, .divider-label::after { content:""; flex:1; height:1px; background:var(--line); }
.icon-check { color: var(--ink); }
.link-arrow { font-weight:600; color:var(--ink); text-decoration:none; display:inline-flex; align-items:center; gap:.35rem; }
.link-arrow:hover { gap:.55rem; color:var(--slate); }

/* Payment (legacy djangobase pages kept) */
#card-element { border:1px solid var(--line); padding:.75rem; border-radius: var(--radius); }
.spinner-border-sm { width:1rem; height:1rem; }

/* Responsive */
@media (max-width: 991.98px) {
  .hero { padding: 3rem 0 2rem; }
  .section { padding: 3rem 0; }
  .navbar .dropdown-menu { box-shadow:none; border:0; padding-left:.5rem; }
  .mega-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .hero h1 { font-size: 2rem; }
  .display-4, .display-5 { font-size: 2rem; }
}
