/* =============================================================
   Super Fans R3LAX — Estilos de registro
   Scope: .sf-page (página formulario) y .sf-confirmation-page (confirmación)
   ============================================================= */

/* ---- Variables de diseño ---- */
:root {
  --sf-bg:           #0c0c0e;
  --sf-surface:      #141418;
  --sf-surface-2:    #1c1c22;
  --sf-border:       rgba(255, 255, 255, 0.07);
  --sf-red:          #9d060d;
  --sf-red-hover:    #c0080f;
  --sf-red-glow:     rgba(157, 6, 13, 0.25);
  --sf-text:         #f2ede8;
  --sf-text-muted:   #7a7585;
  --sf-font:         'Rubik', sans-serif;
  --sf-radius:       10px;
  --sf-transition:   0.2s ease;
}

/* ---- Drupal wrapper reset ---- */
/* Drupal wraps page content in .dialog-off-canvas-main-canvas (direct body child).
   We use position:fixed on .sf-page to cover the full viewport instead of
   trying to hide sibling elements, which would hide the canvas too. */
body:has(.sf-page) {
  overflow: hidden;
}

/* ============================================================
   LAYOUT DE PÁGINA
   ============================================================ */

.sf-page {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  background: var(--sf-bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 0%,   rgba(157, 6, 13, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 100%,  rgba(157, 6, 13, 0.10) 0%, transparent 60%);
  color: var(--sf-text);
  font-family: var(--sf-font);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Header ---- */
.sf-header {
  width: 100%;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sf-border);
  box-sizing: border-box;
}

.sf-header__logo img {
  height: 42px;
  width: auto;
  display: block;
  filter: brightness(1.1);
}

.sf-header__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sf-text-muted);
}

/* ---- Hero del formulario ---- */
.sf-hero {
  text-align: center;
  padding: 48px 20px 36px;
  max-width: 560px;
  width: 100%;
}

.sf-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(157, 6, 13, 0.15);
  border: 1px solid rgba(157, 6, 13, 0.4);
  color: #e06a70;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.sf-hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--sf-red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--sf-red);
  animation: sf-blink 2s ease-in-out infinite;
}

@keyframes sf-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.sf-hero__title {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--sf-text);
  letter-spacing: -0.5px;
}

.sf-hero__title em {
  font-style: normal;
  color: var(--sf-red);
}

.sf-hero__subtitle {
  font-size: 15px;
  color: var(--sf-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ---- Área de mensajes de estado ---- */
.sf-messages {
  width: 100%;
  max-width: 560px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ---- Card del formulario ---- */
.sf-form-card {
  width: 100%;
  max-width: 560px;
  padding: 0 20px 64px;
  box-sizing: border-box;
}

.sf-form-card > div,
.sf-form-card > form {
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: 14px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(157, 6, 13, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.5);
}

.sf-form-card > div::before,
.sf-form-card > form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sf-red) 0%, #e8393e 50%, var(--sf-red) 100%);
  background-size: 200%;
  animation: sf-shimmer 3s linear infinite;
}

@keyframes sf-shimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

/* ---- Footer ---- */
.sf-footer {
  width: 100%;
  margin-top: auto;
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--sf-text-muted);
  border-top: 1px solid var(--sf-border);
}

/* ============================================================
   CAMPOS DEL FORMULARIO
   ============================================================ */

.sf-form-card .form-item {
  margin-bottom: 20px;
}

/* Labels */
.sf-form-card .form-item > label,
.sf-form-card .fieldset-legend,
.sf-form-card .form-item > .label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--sf-text-muted);
  margin-bottom: 8px;
}

/* Required asterisk */
.sf-form-card .form-required::after {
  content: ' *';
  color: var(--sf-red);
}

/* Inputs de texto y URL */
.sf-form-card input[type="text"],
.sf-form-card input[type="url"],
.sf-form-card input[type="tel"],
.sf-form-card input[type="email"] {
  width: 100%;
  background: var(--sf-surface-2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--sf-radius);
  color: var(--sf-text);
  font-family: var(--sf-font);
  font-size: 15px;
  padding: 12px 16px;
  box-sizing: border-box;
  transition: border-color var(--sf-transition), box-shadow var(--sf-transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.sf-form-card input[type="text"]:focus,
.sf-form-card input[type="url"]:focus,
.sf-form-card input[type="tel"]:focus,
.sf-form-card input[type="email"]:focus {
  border-color: var(--sf-red);
  box-shadow: 0 0 0 3px var(--sf-red-glow);
  background: #1f1f26;
}

.sf-form-card input::placeholder {
  color: rgba(255, 255, 255, 0.18);
}

/* Date picker */
.sf-form-card input[type="date"] {
  width: 100%;
  background: var(--sf-surface-2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--sf-radius);
  color: var(--sf-text);
  font-family: var(--sf-font);
  font-size: 15px;
  padding: 12px 16px;
  box-sizing: border-box;
  transition: border-color var(--sf-transition), box-shadow var(--sf-transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  color-scheme: dark;
}

.sf-form-card input[type="date"]:focus {
  border-color: var(--sf-red);
  box-shadow: 0 0 0 3px var(--sf-red-glow);
  background: #1f1f26;
}

.sf-form-card input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(310deg);
  cursor: pointer;
  opacity: 0.7;
}

.sf-form-card input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Description text bajo el campo */
.sf-form-card .description,
.sf-form-card .form-item--description {
  font-size: 12px;
  color: var(--sf-text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ---- Radios ---- */
.sf-form-card .form-radios {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 10px;
}

.sf-form-card .form-type-radio {
  flex: 1;
  margin-bottom: 0 !important;
}

.sf-form-card .form-type-radio label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sf-surface-2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--sf-radius);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--sf-text);
  text-transform: none;
  letter-spacing: 0;
  transition: border-color var(--sf-transition), background var(--sf-transition);
  user-select: none;
  min-height: 46px;
}

.sf-form-card .form-type-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sf-red);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

/* Estado checked del radio */
.sf-form-card .form-type-radio:has(input:checked) label {
  border-color: rgba(157, 6, 13, 0.7);
  background: rgba(157, 6, 13, 0.12);
  color: #f2ede8;
}

/* ---- Botón de envío ---- */
.sf-form-card .form-actions {
  margin-top: 28px;
  padding-top: 0;
  border: none;
}

.sf-form-card .form-actions .button,
.sf-form-card .form-actions input[type="submit"],
.sf-form-card .form-actions button[type="submit"] {
  width: 100%;
  background: var(--sf-red);
  border: none;
  border-radius: var(--sf-radius);
  color: #fff;
  cursor: pointer;
  font-family: var(--sf-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 15px 32px;
  text-transform: uppercase;
  transition: background var(--sf-transition), transform 0.1s, box-shadow var(--sf-transition);
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

.sf-form-card .form-actions .button:hover,
.sf-form-card .form-actions input[type="submit"]:hover,
.sf-form-card .form-actions button[type="submit"]:hover {
  background: var(--sf-red-hover);
  box-shadow: 0 8px 28px rgba(157, 6, 13, 0.45);
  transform: translateY(-2px);
}

.sf-form-card .form-actions .button:active,
.sf-form-card .form-actions input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ---- Mensajes de error ---- */
.sf-form-card .form-item--error-message {
  color: #ff7070;
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.5;
}

.sf-form-card .form-item--error input[type="text"],
.sf-form-card .form-item--error input[type="tel"],
.sf-form-card .form-item--error input[type="url"] {
  border-color: rgba(255, 100, 100, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(255, 70, 70, 0.15) !important;
}

.sf-form-card .messages {
  border-radius: var(--sf-radius);
  margin-bottom: 20px;
  font-size: 14px;
  padding: 12px 16px;
}

.sf-form-card .messages--error {
  background: rgba(255, 59, 59, 0.1);
  border: 1px solid rgba(255, 59, 59, 0.3);
  color: #ff7070;
}

.sf-form-card .messages--status {
  background: rgba(50, 200, 100, 0.1);
  border: 1px solid rgba(50, 200, 100, 0.3);
  color: #6ee09a;
}

/* ============================================================
   PÁGINA DE CONFIRMACIÓN
   ============================================================ */

.sf-confirmation-page {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: var(--sf-bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(157, 6, 13, 0.2) 0%, transparent 60%);
  font-family: var(--sf-font);
  color: var(--sf-text);
  box-sizing: border-box;
}

.sf-confirmation-page__logo {
  margin-bottom: 40px;
}

.sf-confirmation-page__logo img {
  height: 44px;
  filter: brightness(1.1);
}

.sf-confirmation-page__icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 28px;
  display: block;
  animation: sf-pop-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sf-pop-in {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.sf-confirmation-page__card {
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: 16px;
  padding: 40px 36px 36px;
  max-width: 440px;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(157, 6, 13, 0.1),
    0 32px 80px rgba(0, 0, 0, 0.6);
  animation: sf-slide-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

@keyframes sf-slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.sf-confirmation-page__card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sf-red), #e8393e, var(--sf-red));
  background-size: 200%;
  animation: sf-shimmer 2.5s linear infinite;
}

/* Titulo principal */
.sf-confirmation-page__card h2,
.sf-confirmation-page__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--sf-text);
  margin: 0 0 6px;
  line-height: 1.2;
}

.sf-confirmation-page__card .webform-confirmation__message p:first-child {
  font-size: 20px;
  font-weight: 700;
  color: var(--sf-text);
  margin-bottom: 4px;
}

/* Badge del número de socio */
.sf-confirmation-page__card .webform-confirmation__message p:nth-child(2) {
  display: block;
  margin: 20px 0;
}

.sf-confirmation-page__card .webform-confirmation__message p:nth-child(2) strong {
  display: inline-block;
  background: rgba(157, 6, 13, 0.12);
  border: 1px solid rgba(157, 6, 13, 0.5);
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 32px;
  font-weight: 800;
  color: #e8393e;
  letter-spacing: 5px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(157, 6, 13, 0.5);
  animation: sf-number-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes sf-number-reveal {
  from { transform: scale(0.8); opacity: 0; letter-spacing: 10px; }
  to   { transform: scale(1);   opacity: 1; letter-spacing: 5px; }
}

/* Línea divisora entre el número y el mensaje final */
.sf-confirmation-page__card .webform-confirmation__message p:nth-child(3) {
  font-size: 14px;
  color: var(--sf-text-muted);
  margin: 0;
  line-height: 1.6;
  padding-top: 16px;
  border-top: 1px solid var(--sf-border);
}

/* Fallback para cuando el mensaje no tiene el formato esperado */
.sf-confirmation-page__card .webform-confirmation__message p {
  margin: 0 0 12px;
  color: var(--sf-text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.sf-confirmation-page__card .webform-confirmation__message strong {
  color: var(--sf-text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .sf-header {
    padding: 16px 20px;
  }

  .sf-header__logo img {
    height: 36px;
  }

  .sf-hero {
    padding: 36px 0 28px;
  }

  .sf-form-card > div,
  .sf-form-card > form {
    padding: 28px 20px;
  }

  .sf-form-card .form-radios {
    flex-direction: column;
  }

  .sf-confirmation-page__card {
    padding: 32px 20px 28px;
  }

  .sf-confirmation-page__card .webform-confirmation__message p:nth-child(2) strong {
    font-size: 26px;
    letter-spacing: 3px;
    padding: 12px 20px;
  }
}
