/* ============================================================
   La Manada — Buzón visual redesign
   Mobile-first, formulario abierto, UI tipo mini app.
   ============================================================ */

:root {
  --lm-blue-950: #06164d;
  --lm-blue-900: #081e68;
  --lm-blue-800: #0b2d93;
  --lm-blue-700: #1237b0;
  --lm-blue-600: #1d4ed8;
  --lm-yellow: #ffc400;
  --lm-yellow-soft: #fff3bd;
  --lm-bg: #f3f6fb;
  --lm-surface: #ffffff;
  --lm-surface-soft: #f7f9ff;
  --lm-line: #dce4f2;
  --lm-text: #071641;
  --lm-muted: #66728a;
  --lm-danger: #b42318;
  --lm-danger-bg: #fff1f0;
  --lm-radius-sm: 14px;
  --lm-radius-md: 20px;
  --lm-radius-lg: 30px;
  --lm-shadow-card: 0 20px 60px rgba(7, 22, 65, .12);
  --lm-shadow-soft: 0 10px 30px rgba(7, 22, 65, .10);
  --lm-focus: 0 0 0 4px rgba(255, 196, 0, .35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--lm-bg);
}

body.page-buzon {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(18, 55, 176, .07), transparent 38vw),
    linear-gradient(180deg, #f8faff 0%, var(--lm-bg) 100%);
  color: var(--lm-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────────────────── */

.lm-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(245px, 32vw, 430px);
  padding: max(18px, env(safe-area-inset-top)) 18px 84px;
  color: #fff;
  background-color: var(--lm-blue-900);
  background-image: url('/public/icons/lm-hero-bg.svg');
  background-size: cover;
  background-position: center bottom;
}

.lm-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 10px;
  background: var(--lm-yellow);
  z-index: 1;
}

.lm-hero__content {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.lm-hero__logo {
  width: clamp(190px, 44vw, 420px);
  height: auto;
  margin-top: 2px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .18));
}

.lm-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(14px, 3vw, 22px);
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: rgba(255, 255, 255, .90);
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lm-hero__badge img {
  width: 22px;
  height: 22px;
}

.lm-hero__title {
  max-width: 780px;
  margin: 14px 0 0;
  font-size: clamp(2.25rem, 9vw, 5.8rem);
  line-height: .94;
  font-weight: 950;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.lm-hero__title span {
  position: relative;
  display: inline-block;
  color: var(--lm-yellow);
}

.lm-hero__title span::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 4%;
  bottom: -.07em;
  height: .07em;
  border-radius: 999px;
  background: var(--lm-yellow);
  transform: rotate(-2deg);
  opacity: .85;
}

.lm-hero__subtitle {
  max-width: 540px;
  margin: clamp(16px, 2.6vw, 24px) 0 0;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  line-height: 1.45;
  text-wrap: balance;
}

.lm-hero__pets {
  display: none;
}

/* ─────────────────────────────────────────────────────────────
   LAYOUT / CARD
   ───────────────────────────────────────────────────────────── */

.fb-main {
  width: min(100% - 24px, 920px);
  margin: -54px auto 0;
  padding-bottom: 42px;
}

.lm-card__badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--lm-yellow);
  color: var(--lm-blue-950);
  font-size: .71rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(255, 196, 0, .45);
  pointer-events: none;
  white-space: nowrap;
}

.lm-card__badge img {
  width: 15px;
  height: 15px;
}

.fb-card,
.lm-card {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid rgba(220, 228, 242, .92);
  border-radius: var(--lm-radius-lg);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--lm-shadow-card);
  backdrop-filter: blur(14px);
}

.lm-card::before {
  content: "";
  position: absolute;
  inset: 12px 12px auto auto;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: radial-gradient(circle at 55% 40%, rgba(255, 196, 0, .34), transparent 34px);
  pointer-events: none;
  opacity: .75;
}

.fb-card-header,
.lm-card__intro {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--lm-line);
}

.fb-card-icon-wrap,
.lm-card__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: var(--lm-surface-soft);
  box-shadow: inset 0 0 0 1px rgba(18, 55, 176, .08);
}

.fb-card-icon-wrap img,
.lm-card__icon img {
  width: 48px;
  height: 48px;
}

.fb-card-title {
  margin: 0;
  color: var(--lm-text);
  font-size: clamp(1.12rem, 3vw, 1.45rem);
  font-weight: 900;
  letter-spacing: -.025em;
}

.fb-card-subtitle {
  margin: 4px 0 0;
  color: var(--lm-muted);
  font-size: clamp(.9rem, 2.2vw, 1rem);
  line-height: 1.45;
}

.fb-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(180, 35, 24, .16);
  border-radius: 16px;
  color: var(--lm-danger);
  background: var(--lm-danger-bg);
  font-weight: 750;
}

.fb-error::before {
  content: "!";
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: var(--lm-danger);
  font-size: 13px;
}

.fb-section,
.lm-section {
  margin-top: clamp(22px, 4vw, 30px);
}

.fb-question,
.fb-label {
  display: block;
  margin: 0 0 12px;
  color: var(--lm-text);
  font-size: .98rem;
  font-weight: 900;
  letter-spacing: -.01em;
}

.lm-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lm-label-row .fb-label {
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   CHIPS / OPTION CARDS
   ───────────────────────────────────────────────────────────── */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-group--cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--lm-line);
  border-radius: 16px;
  color: var(--lm-text);
  background: #fff;
  box-shadow: 0 1px 0 rgba(7, 22, 65, .03);
  font-size: .93rem;
  font-weight: 780;
  line-height: 1;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.chip img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.chip--card {
  flex-direction: column;
  min-height: 104px;
  gap: 9px;
  padding: 13px 9px;
  border-radius: 18px;
}

.chip--card img {
  width: 42px;
  height: 42px;
}

.chip-label {
  display: block;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(18, 55, 176, .34);
  box-shadow: var(--lm-shadow-soft);
}

.chip:active {
  transform: translateY(0) scale(.99);
}

.chip:focus-visible,
.radio-card:focus-within,
.fb-input:focus,
.fb-textarea:focus,
.fb-submit:focus-visible,
.fb-btn:focus-visible {
  outline: none;
  box-shadow: var(--lm-focus), 0 0 0 1px rgba(18, 55, 176, .16);
}

.chip--selected {
  border-color: rgba(18, 55, 176, .92);
  color: var(--lm-blue-900);
  background: linear-gradient(180deg, #fff 0%, #f4f8ff 100%);
  box-shadow: 0 0 0 1px rgba(18, 55, 176, .08), 0 10px 24px rgba(18, 55, 176, .12);
}

.chip--selected::after {
  content: "✓";
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--lm-blue-700);
  font-size: 13px;
  font-weight: 950;
}

.chip-group--areas .chip {
  flex: 1 1 calc(50% - 10px);
  justify-content: flex-start;
}

/* ─────────────────────────────────────────────────────────────
   FIELDS
   ───────────────────────────────────────────────────────────── */

.fb-textarea,
.fb-input {
  width: 100%;
  border: 1px solid var(--lm-line);
  border-radius: 18px;
  color: var(--lm-text);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.fb-textarea {
  min-height: 150px;
  padding: 16px;
  resize: vertical;
  line-height: 1.55;
}

.fb-input {
  min-height: 50px;
  padding: 0 15px;
}

.fb-textarea::placeholder,
.fb-input::placeholder {
  color: #8a95aa;
}

.fb-textarea:focus,
.fb-input:focus {
  border-color: rgba(18, 55, 176, .88);
  background: #fff;
}

.char-display {
  color: #818ca2;
  font-size: .83rem;
  font-weight: 800;
  white-space: nowrap;
}

.fb-field + .fb-field {
  margin-top: 14px;
}

.contact-fields {
  animation: lmReveal .22s ease both;
}

/* ─────────────────────────────────────────────────────────────
   RADIO CARDS
   ───────────────────────────────────────────────────────────── */

.radio-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.radio-card {
  position: relative;
  display: grid;
  grid-template-columns: 26px 48px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--lm-line);
  border-radius: 20px;
  background: #fff;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  cursor: pointer;
}

.radio-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--lm-shadow-soft);
}

.radio-card input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--lm-blue-700);
}

.radio-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: var(--lm-surface-soft);
}

.radio-card-icon img {
  width: 42px;
  height: 42px;
}

.radio-card-content {
  display: grid;
  gap: 4px;
}

.radio-card-text {
  color: var(--lm-text);
  font-weight: 900;
  letter-spacing: -.01em;
}

.radio-card-sub {
  color: var(--lm-muted);
  font-size: .88rem;
  line-height: 1.35;
}

.radio-card--selected {
  border-color: rgba(18, 55, 176, .92);
  background: linear-gradient(180deg, #fff 0%, #f4f8ff 100%);
  box-shadow: 0 0 0 1px rgba(18, 55, 176, .08), 0 10px 24px rgba(18, 55, 176, .10);
}

/* ─────────────────────────────────────────────────────────────
   TRUST NOTE / SUBMIT / FOOTER
   ───────────────────────────────────────────────────────────── */

.fb-trust-note {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(18, 55, 176, .08);
  border-radius: 20px;
  background: linear-gradient(90deg, rgba(18, 55, 176, .08), rgba(255, 196, 0, .10));
}

.fb-trust-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(7, 22, 65, .06);
}

.fb-trust-icon img {
  width: 38px;
  height: 38px;
}

.fb-trust-note strong {
  display: block;
  color: var(--lm-text);
  font-size: .95rem;
  font-weight: 900;
}

.fb-trust-note p {
  margin: 3px 0 0;
  color: var(--lm-muted);
  font-size: .88rem;
  line-height: 1.4;
}

.fb-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 22px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: var(--lm-blue-700);
  box-shadow: 0 10px 28px rgba(18, 55, 176, .22);
  font-weight: 950;
  letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.fb-submit img {
  width: 28px;
  height: 28px;
}

.fb-submit:hover {
  background: var(--lm-blue-800);
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(18, 55, 176, .30);
}

.fb-submit:active {
  transform: translateY(0) scale(.995);
}

.fb-submit.is-loading {
  opacity: .84;
  cursor: wait;
}

.fb-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 22px auto 0;
  color: var(--lm-muted);
}

.fb-footer-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 10px 4px;
}

.fb-footer-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(7, 22, 65, .05);
}

.fb-footer-icon img {
  width: 34px;
  height: 34px;
}

.fb-footer-item strong {
  color: var(--lm-text);
  font-size: .9rem;
  font-weight: 900;
}

.fb-footer-item p {
  margin: 2px 0 0;
  font-size: .82rem;
  line-height: 1.35;
}

/* ─────────────────────────────────────────────────────────────
   SUCCESS
   ───────────────────────────────────────────────────────────── */

.lm-success {
  position: relative;
  z-index: 5;
  margin: 0 auto;
  border-radius: var(--lm-radius-lg);
  background: #fff;
  box-shadow: var(--lm-shadow-card);
  text-align: center;
  overflow: hidden;
}

.lm-success__top {
  padding: 0 0 46px;
  background: var(--lm-blue-900) url('/public/icons/lm-hero-bg.svg') center/cover;
}

.lm-success__mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: -38px auto 0;
  border: 5px solid #fff;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(7, 22, 65, .14);
  position: relative;
  z-index: 2;
}

.lm-success__mark img {
  width: 60px;
  height: 60px;
}

.lm-success__body {
  padding: 20px clamp(20px, 5vw, 42px) clamp(24px, 4vw, 40px);
}

.success-title {
  margin: 18px 0 0;
  color: var(--lm-blue-900);
  font-size: clamp(1.45rem, 4.5vw, 2.1rem);
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -.03em;
}

.success-body {
  max-width: 400px;
  margin: 10px auto 0;
  color: var(--lm-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.success-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 24px;
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 15px;
  font-weight: 900;
  text-decoration: none;
}

.fb-btn--primary {
  border: 0;
  color: #fff;
  background: var(--lm-blue-700);
}

.fb-btn--ghost {
  border: 1px solid rgba(18, 55, 176, .22);
  color: var(--lm-blue-900);
  background: #fff;
}

/* Compact hero variant (gracias / already-answered pages) */
.lm-hero--compact {
  min-height: clamp(200px, 26vw, 320px) !important;
  padding-bottom: 72px;
}

@media (min-width: 900px) {
  .lm-hero--compact {
    min-height: 340px !important;
    padding-bottom: 90px;
  }
  .lm-hero--compact ~ .fb-main {
    margin-top: -68px;
  }
}

/* Single-button success — span full row then center within it */
.success-actions:has(> :only-child) > * {
  grid-column: 1 / -1;
  max-width: 260px;
  margin-inline: auto;
}

@keyframes lmReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────
   BREAKPOINTS
   ───────────────────────────────────────────────────────────── */

@media (min-width: 420px) {
  .chip-group--cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 640px) {
  .fb-main {
    width: min(100% - 40px, 920px);
    margin-top: -74px;
  }

  .chip-group--cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .chip-group--areas .chip {
    flex: 1 1 calc(33.333% - 10px);
  }

  .contact-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .fb-field + .fb-field {
    margin-top: 0;
  }

  .fb-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .fb-footer-item {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .fb-footer-icon {
    grid-row: auto;
  }

  .success-actions {
    grid-template-columns: 1fr 1fr;
    max-width: 420px;
    margin-inline: auto;
  }
}

@media (min-width: 720px) {
  .radio-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .radio-card {
    grid-template-columns: 26px 56px 1fr;
    min-height: 112px;
    padding: 16px;
  }

  .radio-card-icon {
    width: 56px;
    height: 56px;
  }

  .radio-card-icon img {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 900px) {
  .lm-hero {
    min-height: 470px;
    padding-top: 28px;
  }

  .lm-hero__pets {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 22px;
    display: block;
    width: min(1000px, 92vw);
    height: 310px;
    transform: translateX(-50%);
    background: url('/public/icons/lm-hero-pets.svg') center bottom / contain no-repeat;
    pointer-events: none;
  }

  .lm-hero__content {
    padding-top: 12px;
  }

  .fb-main {
    margin-top: -76px;
  }
}

/* On narrow screens the badge floats in added top-padding space */
@media (max-width: 560px) {
  .fb-card.lm-card {
    padding-top: 56px;
  }
}

@media (max-width: 360px) {
  .fb-main {
    width: min(100% - 20px, 760px);
  }

  .lm-card {
    border-radius: 24px;
  }

  .radio-card {
    grid-template-columns: 22px 42px 1fr;
    gap: 9px;
  }

  .radio-card-icon {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
