/* ==========================================================
   Tutelario.com
   Base color from the logo: #1D3460 (navy)
   ========================================================== */

:root {
  --navy: #1d3460;
  --navy-700: #172b50;
  --navy-800: #122341;
  --navy-900: #0c1830;
  --navy-500: #2a4a82;
  --navy-300: #5b77a8;
  --navy-100: #e6ecf5;
  --navy-50:  #f3f6fb;

  --white: #ffffff;
  --ink: #16223a;
  --muted: #5a6680;
  --line: #d6deea;
  --error: #c0392b;
  --ok: #1f8a5b;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 30px 60px -20px rgba(6, 14, 32, .55), 0 10px 24px -12px rgba(6, 14, 32, .35);

  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--white);
  background-color: var(--navy-800);
  background-image:
    radial-gradient(1200px 700px at 50% -10%, rgba(91, 119, 168, .35), transparent 60%),
    linear-gradient(180deg, var(--navy-500) 0%, var(--navy) 35%, var(--navy-800) 75%, var(--navy-900) 100%);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 48px 16px 96px;
  text-align: center;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Entrada: el logo sube desde abajo y rebota; luego aparecen eslogan y botón */
.hero__inner .logo { animation: logo-in 1.2s cubic-bezier(.25, .8, .35, 1) .15s both; }
.hero__inner .hero__tagline { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .9s both; }
.hero__inner .btn { animation: rise .8s cubic-bezier(.2, .7, .2, 1) 1.1s both; }
.hero__scroll { animation: fade-in .6s ease 1.5s both, bob 2.4s ease-in-out 2.1s infinite; }

@keyframes logo-in {
  0%   { opacity: 0; transform: translateY(90px); }
  45%  { opacity: 1; transform: translateY(-16px); }
  65%  { transform: translateY(6px); }
  82%  { transform: translateY(-3px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.logo {
  margin: 0;
  display: inline-flex;
  align-items: flex-start;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.8rem, 12.5vw, 8.5rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--white);
}

.logo__t {
  width: 0.735em;
  height: 1.05em;
  fill: currentColor;
  flex: none;
  margin-top: 0.035em;
  margin-right: 0.01em;
}

.logo__text { display: inline-block; }

.hero__tagline {
  display: flex;
  align-items: center;
  gap: .9em;
  margin: 1.4rem 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.35rem, 3.4vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: .015em;
  color: rgba(255, 255, 255, .88);
}
.hero__tagline::before,
.hero__tagline::after {
  content: "";
  flex: none;
  width: clamp(24px, 5vw, 64px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55));
}
.hero__tagline::after { transform: scaleX(-1); }

.hero__inner .btn { margin-top: clamp(4rem, 14vh, 9rem); }

@media (max-width: 560px) {
  .hero__tagline { font-size: 5.6vw; }
  .hero__tagline::before,
  .hero__tagline::after { display: none; }
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .6);
  border-radius: 50%;
  transition: color .2s;
}
.hero__scroll:hover { color: var(--white); }
.hero__scroll svg { width: 28px; height: 28px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ---------------- Buttons ---------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 52px;
  padding: 0 1.8rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(255, 255, 255, .6); outline-offset: 3px; }

.btn--light {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .45);
}
.btn--light:hover { box-shadow: 0 16px 34px -10px rgba(0, 0, 0, .55); transform: translateY(-1px); }

.btn--primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 12px 24px -12px rgba(29, 52, 96, .8);
}
.btn--primary:hover { background: var(--navy-500); }
.btn--primary:focus-visible { outline-color: var(--navy-300); }

.btn--block { width: 100%; }

.btn[disabled] { cursor: progress; opacity: .85; }

.btn--primary.is-locked,
.btn--primary.is-locked:hover {
  background: #a9b5ca;
  color: rgba(255, 255, 255, .95);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.shake { animation: shake .4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Intake card ---------------- */

.intake {
  padding: 24px 16px 72px;
  scroll-margin-top: 16px;
}

.card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  color: var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
}

.card__head { margin-bottom: 8px; }

.card h2 {
  margin: 0 0 .4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.card__head p { margin: 0; color: var(--muted); }

/* ---------------- Form ---------------- */

.form__group {
  border: 0;
  margin: 28px 0 0;
  padding: 0;
  min-width: 0;
}

.form__group legend {
  padding: 0;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy-300);
}

.field { margin-bottom: 18px; min-width: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.field label,
.field .label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem; /* 16px avoids iOS zoom on focus */
  color: var(--ink);
  background: var(--white);
  border: 1px solid #c9d3e3;
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  appearance: none;
  -webkit-appearance: none;
}

textarea { resize: vertical; min-height: 130px; line-height: 1.5; }

select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%231d3460' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  cursor: pointer;
}
select:invalid { color: #8a93a8; }
select option { color: var(--ink); }

::placeholder { color: #8a93a8; opacity: 1; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(29, 52, 96, .14);
}

.input-prefix {
  display: flex;
  align-items: stretch;
}
.input-prefix span {
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 600;
  color: var(--navy);
  background: var(--navy-50);
  border: 1px solid #c9d3e3;
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.field__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.counter { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; margin-top: 6px; }

.field__error {
  margin: 6px 0 0;
  font-size: .86rem;
  color: var(--error);
  min-height: 0;
}
.field__error:empty { display: none; }

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--error); }
.field.has-error .input-prefix span { border-color: var(--error); }

/* Urgency: editorial list with hairline dividers */
.choices {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.choice { position: relative; margin: 0 !important; cursor: pointer; }
.choice input,
.segment input,
.check input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  column-gap: 16px;
  padding: 16px 4px 16px 36px;
  border-bottom: 1px solid var(--line);
  transition: background-color .2s ease;
}
.choice > span::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1.5px solid #b7c2d6;
  border-radius: 50%;
  background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.choice strong {
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .005em;
}
.choice small {
  grid-column: 3;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--muted);
  text-align: right;
}
.choice:hover > span { background: linear-gradient(90deg, var(--navy-50), transparent 85%); }
.choice:hover > span::before { border-color: var(--navy-300); }
.choice input:checked + span::before {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 4px var(--white), inset 0 0 0 10px var(--navy);
}
.choice input:checked + span strong { font-weight: 600; color: var(--navy); }
.choice input:focus-visible + span::before { box-shadow: 0 0 0 4px rgba(29, 52, 96, .18); }
.choice input:focus-visible:checked + span::before {
  box-shadow: inset 0 0 0 4px var(--white), inset 0 0 0 10px var(--navy), 0 0 0 4px rgba(29, 52, 96, .18);
}
.field.has-error .choices { border-top-color: var(--error); }
.field.has-error .choice > span::before { border-color: var(--error); }

/* Contact: segmented control */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--navy);
  border-radius: 8px;
  overflow: hidden;
}
.segment { position: relative; margin: 0 !important; cursor: pointer; }
.segment + .segment { border-left: 1px solid var(--navy); }
.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 12px;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--navy);
  background: var(--white);
  transition: background-color .2s ease, color .2s ease;
}
.segment:hover span { background: var(--navy-50); }
.segment input:checked + span { background: var(--navy); color: var(--white); }
.segment input:focus-visible + span { box-shadow: inset 0 0 0 3px rgba(91, 119, 168, .7); }

/* Consent */
.consent { margin-top: 8px; }
.check {
  position: relative;
  display: flex !important;
  gap: 12px;
  align-items: flex-start;
  font-weight: 400 !important;
  font-size: .88rem !important;
  line-height: 1.5;
  color: var(--muted) !important;
  cursor: pointer;
}
.check::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--navy-50) center / 14px no-repeat;
  transition: all .15s;
}
.check:has(input:checked)::before {
  background-color: var(--navy);
  border-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check:has(input:focus-visible)::before { box-shadow: 0 0 0 4px rgba(29, 52, 96, .2); }
.field.has-error .check::before { border-color: var(--error); }
.check a { color: var(--navy); font-weight: 600; }

/* Honeypot: fuera de pantalla, no display:none (algunos bots lo detectan) */
.hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form__status {
  margin: 14px 0 0;
  font-size: .92rem;
  color: var(--error);
  text-align: center;
}
.form__status:empty { display: none; }

.form__note {
  margin: 14px 0 0;
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
}

/* Success */
.success {
  text-align: center;
  padding: 24px 0 8px;
  outline: none;
  animation: rise .6s cubic-bezier(.2, .7, .2, 1) both;
}
.success__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 0 0 10px var(--navy-100);
}
.success__icon svg { width: 36px; height: 36px; }
.success p { max-width: 460px; margin: .6rem auto 0; color: var(--muted); font-size: 1.05rem; }
.success .success__small { font-size: .9rem; margin-top: 1.4rem; }
.success a { color: var(--navy); font-weight: 600; }

/* ---------------- Footer ---------------- */

.footer {
  padding: 8px 16px 40px;
  text-align: center;
  font-size: .86rem;
  color: rgba(255, 255, 255, .7);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin: 0 0 12px;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; }
.footer__disclaimer {
  max-width: 620px;
  margin: 0 auto;
  font-size: .78rem;
  color: rgba(255, 255, 255, .5);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .choice > span { grid-template-columns: 1fr; row-gap: 2px; }
  .choice small { grid-column: 1; text-align: left; font-size: 1rem; }
  .segment span { padding: 0 6px; font-size: .9rem; }
  .card { border-radius: 18px; }
}

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

/* ---------------- Legal page ---------------- */

.legal-top {
  padding: 28px 16px;
  text-align: center;
}
.legal-top a { text-decoration: none; display: inline-block; }
.legal-top .logo { font-size: 2rem; }

.legal {
  padding: 0 16px 56px;
}
.legal .card { max-width: 820px; }
.legal h1 {
  margin: 0 0 .3rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.2;
  color: var(--navy);
}
.legal .updated { margin: 0 0 1.6rem; color: var(--muted); font-size: .9rem; }
.legal h2 {
  font-size: 1.2rem !important;
  margin: 2rem 0 .6rem !important;
}
.legal h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; color: var(--ink); }
.legal p, .legal li { color: #34405a; font-size: .97rem; }
.legal ul, .legal ol { padding-left: 1.3rem; }
.legal li { margin-bottom: .35rem; }
.legal a { color: var(--navy); font-weight: 600; }
.legal .back { margin-top: 2rem; }
