/* ============================================================
   Estudio Beresovsky Notari — estilos
   Paleta tomada del logo: azul marino #032B44 + plateado #D7D9D8
   ============================================================ */

:root {
  --navy: #032b44;
  --navy-900: #021e30;
  --navy-700: #0b3d5c;
  --navy-500: #1f5677;
  --silver: #d7d9d8;
  --silver-200: #e9ebea;
  --silver-blue: #ccd9e1;
  --paper: #f7f8f7;
  --white: #ffffff;
  --ink: #0f1d27;
  --muted: #546572;
  --line: #dde2e5;
  --wa: #25d366;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(3, 43, 68, .12);
  --shadow-lg: 0 24px 60px rgba(3, 43, 68, .22);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-500); }
h1, h2, h3 { font-variant-numeric: lining-nums; font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--white); color: var(--navy); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--silver-blue); outline-offset: 3px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.6em; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-700); box-shadow: var(--shadow); }
.btn-light { background: var(--silver); color: var(--navy); }
.btn-light:hover { background: var(--white); }
.btn-ghost { border-color: rgba(215, 217, 216, .5); color: var(--silver); }
.btn-ghost:hover { border-color: var(--silver); color: var(--white); }
.btn-sm { padding: .6em 1.1em; font-size: .88rem; }
.btn-block { width: 100%; }

.eyebrow { font: 600 .78rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--silver-blue); margin-bottom: 1.1em; }
.eyebrow-dark { color: var(--navy-500); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  border-bottom: 1px solid rgba(215, 217, 216, .12);
  transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand img { height: 60px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--silver); text-decoration: none; font-size: .95rem; font-weight: 500; position: relative; }
.site-nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--silver); transform: scaleX(0); transition: transform .2s; }
.site-nav a:not(.btn):hover::after, .site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { color: var(--white); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--silver); margin: 5px 0; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy); padding: 8px 20px 20px;
    border-bottom: 1px solid rgba(215, 217, 216, .15);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid rgba(215, 217, 216, .1); }
  .site-nav a:not(.btn)::after { display: none; }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(204, 217, 225, .14), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  color: var(--silver);
  padding: 80px 0 110px;
}
.hero::after {
  /* Línea vertical que remite al divisor del monograma B|N */
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 1px; background: linear-gradient(transparent, rgba(215, 217, 216, .12), transparent);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr .9fr; gap: 64px; align-items: center; }
.hero h1 { color: var(--white); }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--silver-blue); }
.lead { font-size: 1.12rem; max-width: 34em; color: rgba(215, 217, 216, .9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 34px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: .9rem; color: rgba(215, 217, 216, .8); }
.hero-points li::before { content: "✓"; color: var(--silver-blue); margin-right: 8px; }

.hero-card {
  background: var(--white); color: var(--ink);
  border-radius: 20px; padding: 34px; box-shadow: var(--shadow-lg);
}
.hero-card-kicker { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--navy-500); margin-bottom: .3em; }
.hero-card h2 { font-size: 1.9rem; }
.hero-card p { color: var(--muted); }
.mini-steps { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 12px; }
.mini-steps li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.mini-steps span { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--silver-200); color: var(--navy); font-family: var(--sans); font-size: .85rem; font-weight: 600; }

@media (max-width: 900px) {
  .hero { padding: 56px 0 80px; }
  .hero::after { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Audiencia ---------- */
.audience { position: relative; z-index: 2; margin-top: -48px; }
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.audience-item { display: flex; align-items: center; gap: 16px; padding: 26px 28px; }
.audience-item + .audience-item { border-left: 1px solid var(--line); }
.audience-item svg { flex: 0 0 40px; height: 40px; fill: none; stroke: var(--navy); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.audience-item strong { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--navy); line-height: 1.2; }
.audience-item span { font-size: .88rem; color: var(--muted); }
@media (max-width: 760px) {
  .audience-grid { grid-template-columns: 1fr; }
  .audience-item + .audience-item { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Secciones ---------- */
.section { padding: 96px 0; }
.section-tint { background: var(--silver-200); }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 48px; }
.section-head p:last-child { color: var(--muted); margin: 0; }
@media (max-width: 640px) { .section { padding: 68px 0; } }

/* ---------- Tabs de servicios ---------- */
.tabs { display: flex; justify-content: center; gap: 6px; margin: 0 auto 36px; padding: 6px; background: var(--silver-200); border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  padding: .75em 1.4em; border-radius: 999px; font: 600 .95rem var(--sans); color: var(--muted);
  transition: background-color .2s, color .2s;
}
.tabs button[aria-selected="true"] { background: var(--navy); color: var(--white); }
.tabs button:hover:not([aria-selected="true"]) { color: var(--navy); }

.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
}
.service-card::before { content: ""; position: absolute; top: 0; left: 24px; width: 36px; height: 3px; background: var(--navy); border-radius: 0 0 3px 3px; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.service-card p { color: var(--muted); font-size: .94rem; margin: 0; }
.tab-panel { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .service-grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .tabs { border-radius: 18px; }
  .tabs button { flex: 1; padding: .7em .5em; font-size: .85rem; white-space: normal; line-height: 1.2; border-radius: 14px; }
}

/* ---------- Trámites ---------- */
.tramites-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tramite-card { background: var(--white); border-radius: var(--radius); padding: 30px 28px; border: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.tramite-card svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--navy); fill: none; stroke: var(--silver); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.tramite-card h3 { margin: 0; }
.tramite-card p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 900px) { .tramites-grid { grid-template-columns: 1fr; } }

/* ---------- Proceso ---------- */
.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; }
.process li { position: relative; padding-top: 18px; border-top: 1px solid rgba(3, 43, 68, .25); }
.process-num { font-variant-numeric: lining-nums; display: block; font-family: var(--serif); font-size: 2.6rem; font-weight: 600; color: var(--navy-500); opacity: .55; line-height: 1; margin-bottom: 10px; }
.process p { color: var(--muted); font-size: .95rem; }
@media (max-width: 900px) { .process { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .process { grid-template-columns: 1fr; } }

/* ---------- Nosotros ---------- */
.about { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: center; }
.about-visual img { border-radius: 20px; box-shadow: var(--shadow-lg); aspect-ratio: 1; object-fit: cover; }
.about-copy p { color: #33434f; }
.values { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.values li { padding-left: 22px; position: relative; }
.values li::before { content: ""; position: absolute; left: 0; top: .65em; width: 10px; height: 1px; background: var(--navy); }
.values strong { color: var(--navy); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 40px; } .about-visual { max-width: 360px; } }

/* ---------- Equipo ---------- */
.team { margin-top: 72px; }
.team-title { text-align: center; font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 32px; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; gap: 28px; }
.team-card { background: var(--white); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.team-card img, .team-photo-placeholder { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.team-photo-placeholder { display: grid; place-items: center; background: var(--navy); color: var(--silver); font-family: var(--serif); font-size: 5rem; font-weight: 600; }
.team-info { padding: 20px 22px 24px; text-align: center; border-top: 3px solid var(--navy); }
.team-info h4 { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.2; color: var(--navy); margin: 0 0 6px; text-wrap: balance;
  /* Reserva dos renglones para que el título y la matrícula queden alineados entre tarjetas */
  min-height: 2.4em; display: flex; align-items: center; justify-content: center; }
.team-role { margin: 0; color: var(--muted); font-size: .95rem; }
.team-mp { margin: 8px 0 0; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-500); font-variant-numeric: tabular-nums; }
.team-card-pending { opacity: .75; }
@media (max-width: 640px) { .team-grid { grid-template-columns: minmax(0, 320px); } }

/* ---------- Novedades ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.news-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--white); border-radius: var(--radius); padding: 26px;
  border: 1px solid var(--line); text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s;
  min-height: 190px;
}
a.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-card.has-img { padding-top: 0; overflow: hidden; }
.news-img { display: block; width: calc(100% + 52px); max-width: none; margin: 0 -26px 6px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--silver-200); }
.news-img-ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-500)); color: var(--silver); font-family: var(--serif); font-size: 1.15rem; letter-spacing: .08em; }
.news-date { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-500); }
.news-card h3 { font-size: 1.3rem; margin: 0; }
.news-card p { font-size: .92rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-link { margin-top: auto; font-size: .88rem; font-weight: 600; color: var(--navy); }
.news-more { text-align: center; margin: 36px 0 0; }
.news-more a { font-weight: 600; color: var(--navy); }
.skeleton { background: linear-gradient(90deg, var(--white) 0%, #f1f3f4 50%, var(--white) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } .news-card { min-height: 0; } }

/* ---------- Contacto ---------- */
.contact { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%); color: var(--silver); }
.contact h2 { color: var(--white); }
.contact-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.contact-info > p { color: rgba(215, 217, 216, .85); }
.contact-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 20px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list svg { flex: 0 0 22px; height: 22px; margin-top: 2px; fill: none; stroke: var(--silver-blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.contact-list a { color: var(--silver); text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--white); text-decoration: underline; }

.contact-form { background: var(--white); color: var(--ink); border-radius: 20px; padding: 36px; box-shadow: var(--shadow-lg); }
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label, .field legend { display: block; font-size: .86rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; padding: 0; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  padding: .8em .95em; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(31, 86, 119, .15); }
.field .invalid, .field input.invalid { border-color: #b3261e; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; pointer-events: none; margin: 0; }
.chip span { display: inline-block; padding: .55em 1em; border: 1.5px solid var(--line); border-radius: 999px; font-size: .88rem; cursor: pointer; transition: all .15s; }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip input:focus-visible + span { outline: 2px solid var(--navy-500); outline-offset: 2px; }
.chips.invalid .chip span { border-color: #b3261e; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--muted); margin: 6px 0 22px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--navy); }
.check.invalid span { color: #b3261e; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.form-status { margin: 14px 0 0; font-size: .9rem; text-align: center; min-height: 1.2em; }
.form-status.error { color: #b3261e; }
.form-status.ok { color: #1b6e3a; }
@media (max-width: 900px) { .contact-inner { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; gap: 0; } .contact-form { padding: 26px 20px; } }


/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: rgba(215, 217, 216, .8); padding: 56px 0 28px; font-size: .92rem; }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; }
.footer-brand img { width: 147px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; }
.footer-nav a, .footer-contact a { color: var(--silver); text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--white); }
.footer-contact { font-style: normal; text-align: right; line-height: 1.8; }
.footer-legal { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(215, 217, 216, .1); font-size: .8rem; color: rgba(215, 217, 216, .55); text-align: center; }
@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer-contact { text-align: center; }
}

/* ---------- WhatsApp ---------- */
.wa { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.wa-fab {
  position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--wa); color: var(--white); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .45); transition: transform .2s;
}
.wa-fab:hover { transform: scale(1.06); }
.wa-fab svg { width: 32px; height: 32px; }
.wa-dot { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; background: #ff3b30; border: 2px solid var(--white); border-radius: 50%; }
.wa-dot.hide { display: none; }
.wa-popup {
  width: min(330px, calc(100vw - 40px));
  background: var(--white); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg);
  transform-origin: bottom right; animation: pop .25s ease;
}
.wa-popup[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
.wa-popup-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--navy); color: var(--silver); }
.wa-popup-head img { border-radius: 50%; width: 40px; height: 40px; }
.wa-popup-head strong { display: block; color: var(--white); font-size: .95rem; }
.wa-popup-head span { font-size: .78rem; opacity: .8; }
.wa-close { margin-left: auto; background: none; border: 0; color: var(--silver); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px; }
.wa-popup-body { padding: 20px 18px; background: #efeae2; }
.wa-bubble { position: relative; background: var(--white); padding: 12px 14px; border-radius: 0 10px 10px 10px; font-size: .92rem; margin: 0; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.wa-popup-cta { display: block; text-align: center; padding: 14px; background: var(--wa); color: var(--white); font-weight: 600; text-decoration: none; }
.wa-popup-cta:hover { background: #1fb957; }
