/* ==========================================================================
   REGISTRO · ObesiCare  (public/css/registro.css)
   - Todo cuelga de .reg-page / .reg-card. No usa variables ni clases del proyecto.
   - Tailwind (en el blade) pone solo la estructura: flex, grid, gap, col-span.
   - Regla: aquí NO se define display en elementos que ya lo reciben de una clase
     de Tailwind, para que nunca compitan.
   - Se evitan los elementos <header>, <section> y <aside> en el marcado: el
     proyecto puede tener estilos globales sobre ellos.
   ========================================================================== */

.reg-body {
  margin: 0;
  background-color: #f4f8fc;
}

/* ---------- Página y variables propias ---------- */
.reg-page {
  --reg-primary: #1f4e94;
  --reg-primary-dark: #15386b;
  --reg-primary-mid: #2b6cb0;
  --reg-ice: #eef6fb;
  --reg-surface: #ffffff;
  --reg-field-bg: #fafcfe;
  --reg-border: #d8e3ef;
  --reg-border-hover: #bacddf;
  --reg-text: #1e293b;
  --reg-text-soft: #334155;
  --reg-muted: #64748b;
  --reg-placeholder: #7a8aa0;
  --reg-danger: #b91c1c;
  --reg-danger-line: #dc2626;
  --reg-danger-bg: #fef2f2;
  --reg-radius: 12px;
  --reg-radius-lg: 20px;
  --reg-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --reg-shadow-card: 0 20px 40px -15px rgba(31, 78, 148, 0.12), 0 0 1px 1px rgba(31, 78, 148, 0.05);
  --reg-focus: 0 0 0 4px rgba(31, 78, 148, 0.16);
  --reg-focus-danger: 0 0 0 4px rgba(185, 28, 28, 0.16);

  position: relative;
  width: 100%;
  margin: 0;
  padding: 4.5rem 1.25rem 11rem;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--reg-text);
  background: radial-gradient(circle at 50% 0%, #e7f2fa 0%, #f4f8fc 65%, #ecf3f9 100%);
  -webkit-font-smoothing: antialiased;
}

.reg-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(31, 78, 148, 0.04) 1px, transparent 1px),
    radial-gradient(rgba(60, 149, 220, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  pointer-events: none;
}

.reg-page .reg-wrapper {
  position: relative;
  z-index: 1;
}

/* ---------- Tarjeta + mini reset acotado (especificidad 0 gracias a :where) ---------- */
.reg-card {
  background: var(--reg-surface);
  border: 1px solid rgba(31, 78, 148, 0.12);
  border-radius: var(--reg-radius-lg);
  box-shadow: var(--reg-shadow-card);
  overflow: hidden;
}

.reg-card :where(*, *::before, *::after) {
  box-sizing: border-box;
}

.reg-card :where(h1, h2, p, ul, li) {
  margin: 0;
  padding: 0;
}

/* ---------- Cabecera de la tarjeta ---------- */
.reg-card .reg-card__header {
  position: relative;
  padding: 2.25rem 2rem 2rem;
  color: #fff;
  background: linear-gradient(135deg, #15386b 0%, #1f4e94 65%, #2b6cb0 100%);
  overflow: hidden;
}

.reg-card .reg-card__header::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.reg-card .reg-pill {
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
}

.reg-card .reg-pill i {
  color: #86efac;
}

.reg-card .reg-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: left;
  text-transform: none;
  color: #fff;
}

.reg-card .reg-card__desc {
  max-width: 680px;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  color: #dce8f6;
}

/* ---------- Cuerpo y secciones ---------- */
.reg-card .reg-form {
  padding: 2.25rem 2.25rem 2.5rem;
  background-color: initial;
}

.reg-card .reg-section {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid #e8eef5;
}

.reg-card .reg-section__icon {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  color: var(--reg-primary);
  background: var(--reg-ice);
  border: 1px solid rgba(31, 78, 148, 0.12);
  border-radius: 10px;
}

.reg-card .reg-section__title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--reg-primary-dark);
}

.reg-card .reg-section__intro {
  font-size: 0.88rem;
  color: var(--reg-muted);
}

/* ---------- Campos ---------- */
.reg-card .reg-field {
  min-width: 0;
}

.reg-card .reg-label {
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
  color: var(--reg-text-soft);
}

.reg-card .reg-req {
  margin-left: 2px;
  font-weight: 700;
  color: var(--reg-danger);
}

.reg-card .reg-hint {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--reg-muted);
}

.reg-card .reg-icon {
  position: absolute;
  left: 1rem;
  font-size: 0.95rem;
  color: #94a3b8;
  pointer-events: none;
}

.reg-card .reg-control:focus-within .reg-icon {
  color: var(--reg-primary);
}

.reg-card .reg-input {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0.65rem 1rem 0.65rem 2.75rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.4;
  color: var(--reg-text);
  background-color: var(--reg-field-bg);
  background-image: none;
  border: 1.5px solid var(--reg-border);
  border-radius: var(--reg-radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.reg-card .reg-input::placeholder {
  font-style: normal;
  font-weight: 400;
  color: var(--reg-placeholder);
  opacity: 1;
}

.reg-card .reg-input:hover {
  background-color: #fff;
  border-color: var(--reg-border-hover);
}

.reg-card .reg-input:focus {
  background-color: #fff;
  border-color: var(--reg-primary);
  box-shadow: var(--reg-focus);
}

.reg-card .reg-input:disabled {
  color: #94a3b8;
  background-color: #eef2f6;
  border-color: #e2e8f0;
  box-shadow: none;
  cursor: not-allowed;
}

.reg-card .reg-input--toggle {
  padding-right: 3rem;
}

/* Select nativo con flecha propia */
.reg-card select.reg-input {
  padding-right: 2.75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.1rem;
}

.reg-card select.reg-input:has(option[value=""]:checked) {
  color: var(--reg-placeholder);
}

.reg-card .reg-input option {
  color: var(--reg-text);
}

/* Botón mostrar / ocultar contraseña */
.reg-card .reg-toggle {
  position: absolute;
  right: 0.6rem;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  color: #94a3b8;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.reg-card .reg-toggle:hover {
  color: var(--reg-primary);
}

.reg-card .reg-toggle:focus-visible {
  outline: none;
  box-shadow: var(--reg-focus);
}

/* ---------- Error: borde + fondo + icono + texto (nunca solo color) ---------- */
.reg-card .reg-error {
  display: none;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--reg-danger);
}

.reg-card .reg-error.is-visible {
  display: flex;
}

.reg-card .reg-error i {
  margin-top: 0.15em;
}

.reg-card .reg-field:has(.reg-error.is-visible) .reg-input {
  background-color: var(--reg-danger-bg);
  border-color: var(--reg-danger-line);
}

.reg-card .reg-field:has(.reg-error.is-visible) .reg-input:focus {
  box-shadow: var(--reg-focus-danger);
}

.reg-card .reg-field:has(.reg-error.is-visible) .reg-option {
  border-color: var(--reg-danger-line);
}

.reg-card .reg-field:has(.reg-error.is-visible) .reg-check__input {
  border-color: var(--reg-danger-line);
}

/* ---------- Tarjetas de selección: código de acceso ---------- */
.reg-card .reg-option-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.reg-card .reg-option {
  height: 100%;
  margin: 0;
  padding: 1rem 1.15rem;
  font-style: normal;
  font-weight: 400;
  text-transform: none;
  background: var(--reg-field-bg);
  border: 2px solid var(--reg-border);
  border-radius: var(--reg-radius);
  cursor: pointer;
  user-select: none;
}

.reg-card .reg-option:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
}

.reg-card .reg-option-input:checked + .reg-option {
  background: #f0f6ff;
  border-color: var(--reg-primary);
  box-shadow: 0 4px 14px rgba(31, 78, 148, 0.12);
}

.reg-card .reg-option-input:focus-visible + .reg-option {
  border-color: var(--reg-primary);
  box-shadow: var(--reg-focus);
}

.reg-card .reg-option__dot {
  width: 20px;
  height: 20px;
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
}

.reg-card .reg-option__dot::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--reg-primary);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
}

.reg-card .reg-option-input:checked + .reg-option .reg-option__dot {
  border-color: var(--reg-primary);
}

.reg-card .reg-option-input:checked + .reg-option .reg-option__dot::after {
  opacity: 1;
  transform: scale(1);
}

.reg-card .reg-badge {
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 6px;
}

.reg-card .reg-badge--novo {
  color: #1d4ed8;
  background: #dbeafe;
}

.reg-card .reg-badge--otro {
  color: #475569;
  background: #f1f5f9;
}

.reg-card .reg-option__title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--reg-text);
}

.reg-card .reg-option__title i {
  margin-right: 0.25rem;
  color: var(--reg-primary);
}

.reg-card .reg-option__text {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--reg-muted);
}

/* ---------- Casillas legales ---------- */
.reg-card .reg-legal {
  padding: 1.25rem 1.5rem;
  background: var(--reg-ice);
  border: 1px solid rgba(31, 78, 148, 0.12);
  border-radius: var(--reg-radius);
}

.reg-card .reg-check {
  margin: 0;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  color: var(--reg-text-soft);
  cursor: pointer;
  user-select: none;
}

.reg-card .reg-check strong {
  font-weight: 700;
  color: var(--reg-primary-dark);
}

.reg-card .reg-check a {
  font-weight: 700;
  color: var(--reg-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reg-card .reg-check a:hover {
  color: var(--reg-primary-dark);
}

.reg-card .reg-check__input {
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  padding: 0;
  background-color: #fff;
  background-image: none;
  border: 2px solid #94a3b8;
  border-radius: 5px;
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.reg-card .reg-check__input:checked {
  background-color: var(--reg-primary);
  background-image: none;
  border-color: var(--reg-primary);
}

.reg-card .reg-check__input:checked::after {
  content: "";
  width: 5px;
  height: 10px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.reg-card .reg-check__input:focus-visible {
  outline: none;
  box-shadow: var(--reg-focus);
}

/* ---------- Medidor de contraseña ---------- */
.reg-card .reg-meter__track {
  height: 4px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 2px;
}

.reg-card .reg-meter__fill {
  width: 0;
  height: 100%;
  border-radius: 2px;
}

.reg-card .reg-meter__fill.is-weak {
  background-color: #dc2626;
}

.reg-card .reg-meter__fill.is-medium {
  background-color: #f59e0b;
}

.reg-card .reg-meter__fill.is-strong {
  background-color: #16a34a;
}

.reg-card .reg-meter__text {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
}

.reg-card .reg-meter__text:empty {
  display: none;
}

.reg-card .reg-meter__text.is-weak {
  color: #b91c1c;
}

.reg-card .reg-meter__text.is-medium {
  color: #b45309;
}

.reg-card .reg-meter__text.is-strong {
  color: #15803d;
}

/* ---------- Botón de envío y pie ---------- */
.reg-card .reg-submit {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 1.5rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background-color: var(--reg-primary);
  background-image: linear-gradient(135deg, var(--reg-primary) 0%, var(--reg-primary-dark) 100%);
  border: 0;
  border-radius: var(--reg-radius);
  box-shadow: 0 10px 20px -5px rgba(31, 78, 148, 0.35);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.reg-card .reg-submit:hover {
  background-image: linear-gradient(135deg, #255eb2 0%, #1a427d 100%);
  box-shadow: 0 14px 25px -5px rgba(31, 78, 148, 0.42);
  transform: translateY(-2px);
}

.reg-card .reg-submit:active {
  transform: translateY(0);
}

.reg-card .reg-submit:focus-visible {
  outline: none;
  box-shadow: var(--reg-focus), 0 10px 20px -5px rgba(31, 78, 148, 0.35);
}

.reg-card .reg-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.reg-card .reg-login {
  font-size: 0.88rem;
  color: var(--reg-muted);
}

.reg-card .reg-login a {
  font-weight: 700;
  color: var(--reg-primary);
  text-decoration: none;
}

.reg-card .reg-login a:hover {
  text-decoration: underline;
}

/* ---------- Animaciones (solo si el usuario no pidió reducir movimiento) ---------- */
@keyframes reg-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .reg-card .reg-input,
  .reg-card .reg-option,
  .reg-card .reg-option__dot,
  .reg-card .reg-option__dot::after,
  .reg-card .reg-check__input,
  .reg-card .reg-toggle,
  .reg-card .reg-icon {
    transition: border-color 0.2s var(--reg-ease), background-color 0.2s var(--reg-ease),
      box-shadow 0.2s var(--reg-ease), color 0.2s var(--reg-ease), opacity 0.2s var(--reg-ease),
      transform 0.2s var(--reg-ease);
  }

  .reg-card .reg-submit {
    transition: transform 0.24s var(--reg-ease), box-shadow 0.24s var(--reg-ease), opacity 0.24s var(--reg-ease);
  }

  .reg-card .reg-meter__fill {
    transition: width 0.3s var(--reg-ease), background-color 0.3s var(--reg-ease);
  }

  .reg-card .reg-reveal {
    animation: reg-reveal 0.28s var(--reg-ease) both;
  }
}

/* ---------- Móvil ---------- */
@media (max-width: 639px) {
  .reg-page {
    padding: 4.25rem 0.75rem 11rem;
  }

  .reg-card .reg-card__header {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .reg-card .reg-card__title {
    font-size: 1.5rem;
  }

  .reg-card .reg-form {
    padding: 1.5rem 1.25rem 2rem;
  }

  .reg-card .reg-legal {
    padding: 1rem 1.1rem;
  }
}
