/* public/styles/crear-cuenta.css
   Estilos del wizard de alta de cuenta self-service.
   Reutiliza tokens --if-* de theme.css y componentes base de style.css
   (login-shell, auth-card, input-field, google-btn, divider). */

.signup-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  grid-template-columns: none;
  width: min(720px, calc(100% - 48px));
}

.signup-shell .auth-panel,
.signup-shell .auth-panel__inner {
  width: 100%;
  min-height: auto;
}

.signup-shell .auth-card {
  width: 100%;
  margin: 0 auto;
}

.signup-disabled {
  padding: 64px;
  text-align: center;
  color: var(--if-text-muted);
}

.google-icon {
  width: 18px;
  height: 18px;
}

.google-icon__blue { fill: #4285F4; }
.google-icon__green { fill: #34A853; }
.google-icon__yellow { fill: #FBBC05; }
.google-icon__red { fill: #EA4335; }

.signup-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  list-style: none;
  margin: 0 0 28px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--if-border);
}

.signup-progress li {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--if-text-muted);
  text-align: center;
}

.signup-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 11px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 1px;
  background: var(--if-border-strong);
}

.signup-progress li.is-done:not(:last-child)::after,
.signup-progress li.is-active:not(:last-child)::after {
  background: var(--if-brand-primary);
}

.signup-progress li::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  box-sizing: border-box;
}

.signup-progress li.is-active {
  color: var(--if-text-strong);
}

.signup-progress li.is-active::before {
  border-color: var(--if-brand-primary);
  background: var(--if-brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--if-brand-primary-rgb), 0.22);
}

.signup-progress li.is-done {
  color: var(--if-text);
}

.signup-progress li.is-done::before {
  content: "";
  border-color: var(--if-brand-primary);
  background: var(--if-brand-primary);
}

.signup-card {
  width: 100%;
}

.signup-step-wide {
  width: 100%;
}

.signup-pwd-wrap {
  position: relative;
}

.signup-pwd-wrap input {
  padding-right: 52px;
}

.signup-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--if-text-muted);
  cursor: pointer;
}

.signup-pwd-toggle:hover,
.signup-pwd-toggle[aria-pressed="true"] {
  color: var(--if-brand-primary);
  background: var(--if-hover-bg);
}

.signup-pwd-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.signup-expand-wrap {
  position: relative;
}

.signup-expand-wrap input {
  padding-right: 52px;
  text-overflow: ellipsis;
}

.signup-expand-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--if-text-muted);
  cursor: pointer;
}

.signup-expand-btn:hover {
  color: var(--if-brand-primary);
  background: var(--if-hover-bg);
}

.signup-expand-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.signup-editor {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--if-bg), transparent 28%);
}

.signup-editor[hidden] {
  display: none;
}

.signup-editor__panel {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--if-border);
  background: var(--if-bg-alt);
  box-shadow: var(--if-card-shadow, 0 24px 56px rgba(15, 23, 42, 0.18));
}

.signup-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signup-editor__header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--if-text-strong);
}

.signup-editor__close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--if-text-muted);
  cursor: pointer;
}

.signup-editor__close:hover {
  color: var(--if-text-strong);
  background: var(--if-hover-bg);
}

.signup-editor__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.signup-editor__textarea {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: var(--if-surface-strong);
  color: var(--if-text-strong);
  font-size: 0.98rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.signup-editor__textarea:focus {
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14);
}

.signup-editor__footer .login-btn {
  width: 100%;
  margin-top: 0;
}

.signup-pwd-wrap.is-mismatch input {
  border-color: rgba(248, 113, 113, 0.7);
}

.signup-pwd-wrap.is-mismatch input:focus {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.signup-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input-field select {
  width: 100%;
  min-height: 54px;
  padding: 0 44px 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background-color: var(--if-surface-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  color: var(--if-text-strong);
  font-size: 0.98rem;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  cursor: pointer;
}

.input-field select:focus {
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14);
}

.input-field select option,
.input-field select optgroup {
  background: var(--if-bg-alt);
  color: var(--if-text-strong);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--if-brand-primary);
  font-weight: 600;
  font-size: inherit;
  cursor: pointer;
}

.link-btn:disabled {
  color: var(--if-text-muted);
  cursor: not-allowed;
}

.signup-back-btn {
  display: block;
  margin: 18px auto 0;
  font-weight: 500;
  color: var(--if-text-muted);
}

/* --- OTP: inputs individuales estilo Mercado Pago / Twitch, adaptado a InteliaFlow --- */
.otp-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.otp-inputs {
  display: flex;
  gap: 10px;
}

.otp-digit {
  width: 48px;
  height: 58px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: var(--if-surface-strong);
  color: var(--if-text-strong);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.otp-digit:focus {
  border-color: var(--if-brand-primary);
  box-shadow: var(--if-focus-ring);
}

.otp-form .login-btn {
  width: 100%;
}

/* --- Carrusel de rasgo de personalidad --- */
.trait-carousel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.trait-carousel__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trait-carousel__arrow {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--if-border);
  background: var(--if-surface);
  color: var(--if-text-strong);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.trait-carousel__arrow:hover:not(:disabled) {
  border-color: rgba(var(--if-brand-primary-rgb), 0.45);
  color: var(--if-brand-primary);
  background: var(--if-hover-bg);
}

.trait-carousel__arrow:focus-visible {
  outline: none;
  box-shadow: var(--if-focus-ring);
}

.trait-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.trait-carousel__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trait-carousel__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

.trait-grid {
  display: flex;
  gap: 12px;
  width: max-content;
  margin-bottom: 0;
  padding-inline: var(--trait-edge-pad, 0px);
  will-change: transform;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.trait-carousel.is-instant .trait-grid {
  transition: none;
}

.trait-card {
  flex: 0 0 150px;
  width: 150px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 16px;
  border: 1px solid var(--if-border);
  background: var(--if-surface);
  cursor: pointer;
  text-align: center;
  opacity: 0.42;
  transition: opacity 0.28s ease, border-color 0.28s ease, background-color 0.28s ease;
}

.trait-card:hover {
  border-color: rgba(var(--if-brand-primary-rgb), 0.4);
}

.trait-card:focus-visible {
  outline: none;
  box-shadow: var(--if-focus-ring);
}

.trait-card.is-selected {
  opacity: 1;
  border-color: var(--if-brand-primary);
  background: var(--if-soft-primary);
}

.trait-card__image {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--if-bg-strong);
}

.trait-card__label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--if-text-strong);
}

.trait-card__description {
  font-size: 0.78rem;
  color: var(--if-text-muted);
  line-height: 1.4;
}

.trait-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.trait-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.28s ease;
}

.trait-carousel__dot.is-active {
  width: 20px;
  background: var(--if-brand-primary);
}

.trait-carousel__dot:focus-visible {
  outline: none;
  box-shadow: var(--if-focus-ring);
}

@media (prefers-reduced-motion: reduce) {
  .trait-grid,
  .trait-card,
  .trait-carousel__arrow,
  .trait-carousel__dot {
    transition: none;
  }
}

/* --- Planes: reutiliza subscription-plans.css, compacto en el wizard --- */
.signup-card .subscription-plans-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.45rem 0 0;
  margin-bottom: 20px;
}

.signup-card .subscription-plan-card {
  padding: 1.1rem 1rem 1rem;
}

.signup-card .subscription-plan-price {
  font-size: 1.25rem;
}

.signup-card .subscription-plan-tagline {
  min-height: 2.3em;
}

.signup-mp-payer {
  margin: 20px 0 8px 0;
}

.signup-mp-payer-help {
  margin: 8px 0 0 0;
  min-height: 2.8em;
  font-size: 13px;
  line-height: 1.4;
  color: var(--if-text-muted);
}

.signup-mp-payer-preview {
  margin: 8px 0 0 0;
  min-height: 1.4em;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--if-text);
}

.signup-mp-payer-error {
  margin: 4px 0 0 0;
  min-height: 1.4em;
  font-size: 12px;
  line-height: 1.4;
  color: #f87171;
}

/* --- Loader final --- */
.signup-loader {
  width: 44px;
  height: 44px;
  margin: 24px auto 8px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--if-brand-primary);
  animation: signupSpin 0.9s linear infinite;
}

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

@media (max-width: 1120px) {
  .signup-shell {
    width: min(720px, calc(100% - 32px));
  }
}

@media (max-width: 520px) {
  .signup-grid-2 {
    grid-template-columns: 1fr;
  }

  .signup-card .subscription-plans-grid {
    grid-template-columns: 1fr;
  }

  .otp-digit {
    width: 40px;
    height: 50px;
    font-size: 1.25rem;
  }
}
