/* ---------------------------------------------------------------------------
   Loyalty sign-up microsite — "Línea" editorial-minimal styling
   La Colonia / CASAMANTICA · underline-only inputs, generous whitespace,
   red + navy, Schibsted Grotesk. Mobile-first; single white card.
--------------------------------------------------------------------------- */

:root {
  --lc-red: #E5141B;
  --lc-red-deep: #C00F15;
  --lc-navy: #14203B;
  --lc-ink: #1B2740;
  --lc-muted: #6A7488;
  --lc-faint: #98A1B3;
  --lc-label: #515B72;
  --lc-line: #E4E8F0;
  --lc-bg: #F5F7FA;
  --white: #ffffff;
  --danger: #DC2626;
  --success: #16A34A;

  --radius-card: 24px;
  --radius-btn: 12px;

  --font: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background: var(--lc-bg);
  color: var(--lc-ink);
  line-height: 1.45;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 20px calc(48px + env(safe-area-inset-bottom));
}

/* ---- Card --------------------------------------------------------------- */
.card {
  width: 100%;
  max-width: 452px;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(20, 32, 59, 0.04), 0 30px 60px -30px rgba(20, 32, 59, 0.20);
  padding: 40px 38px 34px;
}

/* ---- Brand header ------------------------------------------------------- */
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 0;
}

.brand__mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--lc-red);
  color: var(--white);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lc-faint);
}

.brand__title {
  margin: 1px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--lc-navy);
  line-height: 1.1;
}

.lead {
  margin: 16px 0 26px;
  font-size: 15px;
  font-weight: 500;
  color: var(--lc-muted);
}

/* ---- Fields ------------------------------------------------------------- */
.field { margin-bottom: 22px; }

/* Direct-child only, so it doesn't style the nested .gender-option labels. */
.field > label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lc-label);
  margin-bottom: 9px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.field-row > .field { margin-bottom: 0; }

/* Underline-only text inputs. */
input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  font-family: var(--font);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--lc-ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--lc-line);
  border-radius: 0;
  padding: 8px 2px;
  height: 44px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease;
}

input::placeholder { color: var(--lc-faint); }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-bottom: 2px solid var(--lc-red);
}

.field--invalid input[type="text"],
.field--invalid input[type="email"],
.field--invalid input[type="tel"] {
  border-bottom-color: var(--danger);
}

.field__error {
  margin: 7px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
}
.field__error:empty { display: none; }

/* ---- Phone row ---------------------------------------------------------- */
.phone-row {
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid var(--lc-line);
  transition: border-color 0.15s ease;
}
.phone-row:focus-within { border-bottom-color: var(--lc-red); }
.field--invalid .phone-row { border-bottom-color: var(--danger); }

.phone-cc {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--lc-line);
  margin-right: 14px;
}

.phone-cc select {
  font-family: var(--font);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--lc-navy);
  background: transparent;
  border: 0;
  border-radius: 0;
  height: 44px;
  padding: 0 30px 0 2px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2314203B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.phone-cc select:focus { outline: none; }

.phone-num {
  flex: 1 1 auto;
  min-width: 0;
  border: 0 !important;
  border-bottom: 0 !important;
  height: 44px;
}
.phone-num:focus { border-bottom: 0 !important; }

/* ---- Gender (inline radios) --------------------------------------------- */
.gender-row {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-top: 2px;
}

.gender-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 16.5px;
  font-weight: 500;
  color: var(--lc-ink);
}

.gender-option input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 2px solid var(--lc-line);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: border-color 0.15s ease;
}
.gender-option input[type="radio"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lc-red);
  transform: scale(0);
  transition: transform 0.12s ease;
}
.gender-option input[type="radio"]:checked { border-color: var(--lc-red); }
.gender-option input[type="radio"]:checked::before { transform: scale(1); }
.gender-option input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 20, 27, 0.18);
}
.field--invalid .gender-option input[type="radio"] { border-color: var(--danger); }

/* ---- Date of birth: Día/Mes/Año dropdowns ------------------------------- */
.date-selects {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
}

.date-selects select {
  width: 100%;
  min-width: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--lc-ink);
  background: var(--white);
  border: 1px solid var(--lc-line);
  border-radius: 8px;
  height: 44px;
  padding: 0 28px 0 10px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2314203B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.date-selects select:focus { outline: none; border-color: var(--lc-red); }
.field--invalid .date-selects select { border-color: var(--danger); }

/* ---- Turnstile (interaction-only → usually invisible) ------------------- */
.field--turnstile { margin-bottom: 18px; }
#turnstile-widget { display: flex; justify-content: center; }
#turnstile-widget:empty { display: none; }

/* ---- Global form error -------------------------------------------------- */
.form-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger);
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-btn);
}

/* ---- Button ------------------------------------------------------------- */
.btn {
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--white);
  background: var(--lc-red);
  border-radius: var(--radius-btn);
  height: 52px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn:hover { background: var(--lc-red-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: 0.65; }

.btn__arrow {
  display: inline-flex;
  transition: transform 0.15s ease;
}
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn.is-loading .btn__arrow { display: none; }

.btn__spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .btn__spinner { animation-duration: 1.4s; }
  .btn__arrow { transition: none; }
  .btn:hover .btn__arrow { transform: none; }
}

/* ---- Legal -------------------------------------------------------------- */
.legal {
  margin: 18px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--lc-faint);
  line-height: 1.5;
}
.legal a {
  color: var(--lc-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal a:hover { color: var(--lc-muted); }

/* ---- Success state ------------------------------------------------------ */
.success {
  text-align: center;
  padding: 8px 0 6px;
}

.success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #DCFCE7;
  color: var(--success);
  font-size: 34px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success__title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
  color: var(--lc-navy);
}

.success__msg {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--lc-muted);
}

.success__card {
  background: var(--lc-navy);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.success__card-label {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lc-faint);
}

.success__card-no {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--white);
  word-break: break-all;
}

.success__hint {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--lc-muted);
}

/* ---- Mobile: full-bleed ------------------------------------------------- */
/* White fills the viewport edge-to-edge — no gray margin, no floating card.
   (body = page wrapper, .card = card wrapper + inner padding.) */
@media (max-width: 560px) {
  body {
    background: var(--white);
    padding: 0;
    align-items: stretch;
  }
  .card {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 100dvh;
    padding: 30px 22px calc(32px + env(safe-area-inset-bottom));
  }
}

/* Stack the Nombre/Apellidos row on the narrowest phones. */
@media (max-width: 380px) {
  .field-row { grid-template-columns: 1fr; gap: 22px; }
}
