/*
 * Identidad Alimentos Mary.
 * Colores provisionales: reemplazar por los códigos exactos del manual de marca.
 */
:root {
  --brand: #c8102e;        /* rojo Mary */
  --brand-dark: #9e0c24;
  --brand-soft: #fdecee;   /* fondo de botones tipo píldora */
  --accent: #f6b400;       /* amarillo de apoyo */
  --text: #1f1f1f;
  --muted: #5f6368;
  --border: #d9d9de;
  --bg: #f2f2f4;
  --card: #ffffff;
  --error: #b3261e;
  --ok: #1b8a4a;
  --radius: 24px;
  --shadow: 0 4px 18px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Roboto Condensed", "Arial Narrow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* Franja roja de marca arriba, fondo con la trama del isotipo y tarjeta centrada sobre la franja */
.page-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
  background:
    linear-gradient(180deg, var(--brand) 0, var(--brand) 180px, transparent 180px) top / 100% 180px no-repeat,
    #fff url("../img/fondo-blanca.jpg") center top / cover no-repeat;
}
@media (min-width: 900px) and (hover: hover) {
  .page-center { background-attachment: scroll, fixed; }
}

.card {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 20px;
}
.card--select { max-width: 700px; text-align: center; padding: 40px 24px 48px; }
.card--form { max-width: 720px; }
@media (min-width: 640px) { .card--form { padding: 40px 48px; } }

/* Logo */
.brand { display: block; text-align: center; text-decoration: none; margin-bottom: 20px; }
.brand-logo { max-width: min(100%, 320px); max-height: 110px; width: auto; height: auto; }

h1 { font-size: clamp(24px, 5vw, 30px); line-height: 1.2; margin: 0 0 12px; text-align: center; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; }

/* Selector de tipo de formulario */
.select-list { display: flex; flex-direction: column; gap: 16px; max-width: 490px; margin: 0 auto; }
.btn-pill {
  display: block;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 19px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  border-radius: 999px;
  padding: 12px 24px;
  transition: background .15s, color .15s, transform .1s;
}
.btn-pill small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.btn-pill:hover, .btn-pill:focus-visible { background: var(--brand); color: #fff; }
.btn-pill:hover small, .btn-pill:focus-visible small { color: rgba(255, 255, 255, .85); }
.btn-pill:active { transform: scale(.98); }
.btn-pill:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Formulario */
.switch-type { text-align: center; margin: 0 0 24px; }
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px 9px 14px; min-height: 42px;
  font-size: 15px; font-weight: 700; letter-spacing: .2px; text-decoration: none;
  color: var(--brand); background: var(--brand-soft);
  border: 1.5px solid transparent; border-radius: 999px;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn-back svg { flex: none; transition: transform .15s; }
.btn-back:hover, .btn-back:focus-visible { background: var(--brand); color: #fff; }
.btn-back:hover svg { transform: translateX(-3px); }
.btn-back:active { transform: scale(.97); }
.btn-back:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.notice { background: var(--bg); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px 18px; margin-bottom: 24px; font-size: 15px; }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin-bottom: 0; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.section { border-top: 1px solid var(--border); padding-top: 20px; margin-bottom: 8px; }
.section legend {
  float: left; width: 100%;
  font-size: 19px; font-weight: 700; color: var(--brand);
  margin-bottom: 14px; padding: 0;
}
.section legend + * { clear: both; }

.row { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .row { grid-template-columns: 1fr 1fr; } }

.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--error); font-weight: 700; margin-left: 2px; }
.opt { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 4px; }
.hint { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.error { margin: 4px 0 0; font-size: 14px; color: var(--error); font-weight: 600; }
.error:empty { display: none; }

input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 11px 14px;
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 72px; }
select:disabled { background: var(--bg); color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 16, 46, .18); }
[aria-invalid="true"] { border-color: var(--error) !important; }

.input-group { display: flex; }
.input-group select { width: 72px; flex: none; border-radius: 12px 0 0 12px; border-right: 0; background: var(--bg); font-weight: 700; }
.input-group input { border-radius: 0 12px 12px 0; }

/* Verificación anti-bots (Turnstile) */
.turnstile { display: flex; justify-content: center; margin-top: 8px; }
.turnstile:empty { display: none; }

/* Tipo de negocio: tarjetas */
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 420px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice-card {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px;
  text-align: center; padding: 10px 8px; border: 1.5px solid var(--border); border-radius: 14px;
  background: #fff; cursor: pointer; transition: border-color .15s, background .15s;
}
.choice-card:hover { border-color: var(--brand); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice-card:has(input:focus-visible) { outline: 3px solid rgba(200, 16, 46, .35); outline-offset: 2px; }
.choice-card:has(input[aria-invalid="true"]) { border-color: var(--error); }
.choice-card strong { font-size: 14px; font-weight: 600; line-height: 1.25; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 7px 16px; border: 1.5px solid var(--border); border-radius: 999px; font-size: 15px; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid rgba(200, 16, 46, .35); outline-offset: 2px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400 !important; cursor: pointer; text-align: justify; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

.btn-submit {
  display: block; width: 100%; max-width: 490px; margin: 16px auto 0;
  font: inherit; font-size: 18px; font-weight: 700;
  background: var(--brand); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 24px; min-height: 52px; cursor: pointer; transition: background .15s;
}
.btn-submit:hover { background: var(--brand-dark); }
.btn-submit:disabled { opacity: .6; cursor: progress; }
.btn-submit:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.form-error { text-align: center; margin-top: 12px; }

/* Página de gracias */
.success-icon {
  width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 44px; font-weight: 700;
  background: var(--brand); color: #fff;
  box-shadow: 0 0 0 10px var(--brand-soft);
}
.gracias h1 { color: var(--brand); }
.gracias .lead { margin-bottom: 12px; }
.gracias-texto { font-size: 18px; max-width: 480px; margin: 0 auto 24px; }
.gracias-solicitud {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  max-width: 380px; margin: 0 auto 28px; padding: 16px 20px;
  border: 1.5px dashed var(--brand); border-radius: 16px; background: var(--brand-soft);
}
.gracias-solicitud span { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.gracias-solicitud strong { font-size: clamp(17px, 5vw, 22px); letter-spacing: .5px; color: var(--brand); white-space: nowrap; }
.gracias-solicitud small { font-size: 13px; color: var(--muted); }
.gracias-btn { max-width: 320px; margin: 0 auto; text-align: center; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
