:root {
  --senshi-bg: #080808;
  --senshi-surface: #0D0D0E;
  --senshi-surface-soft: #151516;
  --senshi-input: rgba(18, 18, 19, 0.82);
  --senshi-border: rgba(255, 255, 255, 0.18);
  --senshi-border-hover: rgba(255, 255, 255, 0.32);
  --senshi-red: #C8102E;
  --senshi-red-bright: #ED1638;
  --senshi-text: #F4F4F5;
  --senshi-text-secondary: #A1A1A6;
  --senshi-text-muted: #75757A;
  --senshi-success: #22C55E;
  --senshi-error: #FB4B62;
  --senshi-radius-card: 11px;
  --senshi-radius-control: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--senshi-bg);
  color: var(--senshi-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  display: grid;
  place-items: center;
  align-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 16, 46, 0.08), transparent 38%),
    #080808;
}

.auth-card {
  position: relative;
  width: min(100%, 478px);
  min-height: 760px;
  height: auto;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--senshi-border);
  border-radius: var(--senshi-radius-card);
  background: var(--senshi-surface);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  animation: auth-card-in 0.45s ease both;
  transition:
    min-height 180ms ease,
    box-shadow 180ms ease;
}

@keyframes auth-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card__background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 62%;
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      rgba(6, 6, 7, 0.12) 0%,
      rgba(8, 8, 9, 0.32) 32%,
      rgba(10, 10, 11, 0.78) 72%,
      var(--senshi-surface) 100%
    ),
    linear-gradient(
      to right,
      rgba(0, 0, 0, 0.30),
      transparent 50%,
      rgba(0, 0, 0, 0.30)
    ),
    url("../img/dojo.jpg") center / cover no-repeat;
  filter: saturate(0.55) contrast(1.08);
}

.auth-card__background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 28%, transparent 42%, rgba(0, 0, 0, 0.5) 100%);
}

.auth-card__content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 42px;
}

/* === Volver al login === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 26px;
  font-size: 13px;
  font-weight: 600;
  color: var(--senshi-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-link__icon {
  width: 16px;
  height: 16px;
}

.back-link:hover {
  color: var(--senshi-text);
}

.back-link:focus-visible {
  outline: 2px solid var(--senshi-red-bright);
  outline-offset: 2px;
  border-radius: 3px;
}

/* === Encabezado === */
.auth-header {
  margin-top: 22px;
  text-align: center;
}

.auth-header__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--senshi-red-bright);
  background: rgba(200, 16, 46, 0.10);
  border: 1px solid rgba(232, 20, 50, 0.28);
  border-radius: 50%;
}

.auth-header__icon svg {
  width: 28px;
  height: 28px;
}

.auth-header__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--senshi-text);
  letter-spacing: -0.01em;
}

.auth-header__rule {
  width: 26px;
  height: 2px;
  margin: 13px auto 0;
  background: #E81432;
}

.auth-header__subtitle {
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: #8C8C91;
}

/* === Progreso === */
.register-progress {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.register-progress__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  opacity: 0.42;
  transition: opacity 0.2s ease;
}

.register-progress__step.is-active {
  opacity: 1;
}

.register-progress__number {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--senshi-border-hover);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--senshi-text-secondary);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.register-progress__step.is-active .register-progress__number {
  background: var(--senshi-red);
  border-color: var(--senshi-red);
  color: #FFFFFF;
}

.register-progress__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--senshi-text-secondary);
}

/* === Formulario === */
.register-form {
  margin-top: 24px;
}

.register-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.register-panel[aria-disabled="true"] {
  opacity: 0.45;
}

.register-panel__lock {
  display: none;
}

.register-panel[aria-disabled="true"] .register-panel__lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  padding: 8px 12px;
  border: 1px dashed var(--senshi-border);
  border-radius: var(--senshi-radius-control);
  font-size: 12px;
  font-weight: 600;
  color: var(--senshi-text-muted);
}

.register-panel__lock svg {
  width: 16px;
  height: 16px;
}

.field {
  position: relative;
  height: 62px;
}

.floating-field input {
  width: 100%;
  height: 100%;
  padding: 24px 52px 8px 52px;
  font-family: inherit;
  font-size: 15px;
  color: var(--senshi-text);
  background: rgba(18, 18, 19, 0.84);
  border: 1px solid var(--senshi-border);
  border-radius: var(--senshi-radius-control);
  outline: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.floating-field input::placeholder {
  color: transparent;
}

.floating-field:hover input {
  border-color: var(--senshi-border-hover);
}

.floating-field:focus-within input {
  border-color: var(--senshi-red);
  background: rgba(26, 26, 28, 0.9);
  box-shadow: 0 0 0 3px rgba(232, 20, 50, 0.16);
}

.floating-field.is-invalid input {
  border-color: rgba(251, 75, 98, 0.75);
  box-shadow: 0 0 0 3px rgba(251, 75, 98, 0.12);
}

.floating-field.is-invalid .field__icon {
  color: var(--senshi-error);
}

.floating-field.is-invalid label {
  color: var(--senshi-error);
}

.floating-field label {
  position: absolute;
  top: 50%;
  left: 52px;
  max-width: calc(100% - 112px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0;
  transform: translateY(-50%);
  transform-origin: left center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: #85858A;
  background: transparent;
  pointer-events: none;
  z-index: 1;
  transition:
    top 180ms ease,
    transform 180ms ease,
    color 180ms ease,
    font-size 180ms ease;
}

.floating-field:focus-within label,
.floating-field input:not(:placeholder-shown) + label {
  top: 13px;
  transform: translateY(0);
  font-size: 11px;
  font-weight: 600;
  background: transparent;
}

.floating-field input:not(:placeholder-shown) + label {
  color: #A1A1A6;
}

.floating-field:focus-within label,
.floating-field:focus-within input:not(:placeholder-shown) + label {
  color: var(--senshi-red-bright);
}

.floating-field input:-webkit-autofill + label {
  top: 10px;
  transform: translateY(0);
  font-size: 11px;
  font-weight: 600;
  color: #A1A1A6;
  background: transparent;
}

.floating-field--date label,
.floating-field input[type="date"] + label {
  top: 10px;
  transform: translateY(0);
  font-size: 11px;
  font-weight: 600;
  color: #A1A1A6;
  background: transparent;
}

.floating-field--date:focus-within label {
  color: var(--senshi-red-bright);
}

.floating-field.is-invalid label,
.floating-field.is-invalid input:not(:placeholder-shown) + label,
.floating-field.is-invalid:focus-within label,
.floating-field.is-invalid:focus-within input:not(:placeholder-shown) + label {
  color: var(--senshi-error);
}

.floating-field input:-webkit-autofill,
.floating-field input:-webkit-autofill:hover,
.floating-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(18, 18, 19, 0.84) inset;
  -webkit-text-fill-color: var(--senshi-text);
  caret-color: var(--senshi-text);
  transition: background-color 9999s ease-out 0s;
}

.floating-field input:disabled {
  cursor: not-allowed;
  color: var(--senshi-text-muted);
}

.field__icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: #85858A;
  pointer-events: none;
  transition: color 0.15s ease;
}

.floating-field:focus-within .field__icon {
  color: var(--senshi-text);
}

.field__icon svg {
  width: 20px;
  height: 20px;
}

.field--password input {
  padding-right: 58px;
}

/* === Paso 1: invitación === */
.invitation-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--senshi-radius-control);
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.invitation-result__badge {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--senshi-success);
  background: rgba(34, 197, 94, 0.12);
  border-radius: 50%;
}

.invitation-result__badge svg {
  width: 16px;
  height: 16px;
}

.invitation-result__title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--senshi-success);
}

.invitation-result__role {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--senshi-text-secondary);
}

.invitation-result__role-name {
  font-weight: 700;
  color: var(--senshi-text);
  text-transform: capitalize;
}

.invitation-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--senshi-radius-control);
  border: 1px solid rgba(237, 22, 56, 0.25);
  background: rgba(237, 22, 56, 0.06);
  animation: banner-fade-in 0.35s ease both;
}

@keyframes banner-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.invitation-info-banner__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--senshi-red-bright);
  margin-top: 1px;
}

.invitation-info-banner__icon svg {
  width: 20px;
  height: 20px;
}

.invitation-info-banner__body {
  flex: 1;
  min-width: 0;
}

.invitation-info-banner__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--senshi-text);
  margin-bottom: 3px;
}

.invitation-info-banner__text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--senshi-text-secondary);
  margin: 0;
}

.invitation-info-banner__text strong {
  color: var(--senshi-text);
  font-weight: 600;
  text-transform: capitalize;
}

.invitation-actions {
  display: flex;
  gap: 10px;
}

.invitation-actions .submit-btn {
  flex: 1;
}

/* === Botones === */
.submit-btn {
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-radius: var(--senshi-radius-control);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.submit-btn--primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, #C8102E, #E80732);
  border: none;
}

.submit-btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 24px rgba(232, 7, 50, 0.28);
}

.submit-btn--primary:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.submit-btn--primary:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}

.submit-btn--primary:disabled {
  cursor: wait;
  opacity: 0.75;
  filter: none;
  box-shadow: none;
}

.submit-btn--ghost {
  color: var(--senshi-text-secondary);
  background: transparent;
  border: 1px solid var(--senshi-border);
}

.submit-btn--ghost:hover {
  color: var(--senshi-text);
  border-color: var(--senshi-border-hover);
}

.submit-btn--ghost:focus-visible {
  outline: 2px solid var(--senshi-red-bright);
  outline-offset: 3px;
}

/* === Medidor de fortaleza === */
.strength {
  padding: 12px 14px;
  border: 1px solid var(--senshi-border);
  border-radius: var(--senshi-radius-control);
  background: rgba(18, 18, 19, 0.6);
}

.strength__label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--senshi-text-muted);
  margin-bottom: 8px;
}

.strength__list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
}

.strength__item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--senshi-text-secondary);
  transition: color 0.15s ease;
}

.strength__indicator {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1.5px solid var(--senshi-border-hover);
  border-radius: 50%;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.strength__item.is-met {
  color: var(--senshi-success);
}

.strength__item.is-met .strength__indicator {
  background: var(--senshi-success);
  border-color: var(--senshi-success);
}

.strength__bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.strength__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--senshi-red);
  border-radius: 999px;
  transition: width 0.2s ease, background 0.2s ease;
}

.strength__bar-fill.is-weak {
  background: var(--senshi-error);
}

.strength__bar-fill.is-medium {
  background: #F59E0B;
}

.strength__bar-fill.is-strong {
  background: var(--senshi-success);
}

/* === Mensajes === */
.form-message-slot {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  transition:
    grid-template-rows 180ms ease,
    margin-top 180ms ease,
    opacity 150ms ease;
}

.form-message-slot.is-visible {
  grid-template-rows: 1fr;
  margin-top: 14px;
  opacity: 1;
}

.form-message {
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  padding: 0 12px;
  border-width: 0;
  border-style: solid;
  border-radius: var(--senshi-radius-control);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  transition:
    min-height 180ms ease,
    padding 180ms ease,
    border-width 180ms ease;
}

.form-message-slot.is-visible .form-message {
  min-height: 44px;
  visibility: visible;
  pointer-events: auto;
  padding: 9px 12px;
  border-width: 1px;
}

.form-message--error {
  color: var(--senshi-error);
  background: rgba(251, 75, 98, 0.08);
  border-color: rgba(251, 75, 98, 0.32);
}

.form-message--success {
  color: var(--senshi-success);
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.32);
}

.form-message--info {
  color: var(--senshi-text-secondary);
  background: rgba(161, 161, 166, 0.08);
  border-color: rgba(161, 161, 166, 0.25);
}

.form-message.auth-animated {
  animation: auth-message-enter 0.3s ease both;
}

.form-message.auth-animated.auth-msg-leaving {
  animation: auth-message-leave 0.35s ease forwards;
}

@keyframes auth-message-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-message-leave {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 120px;
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
  }
}

/* === Botón Crear cuenta === */
.register-submit {
  position: relative;
  width: 100%;
  height: 60px;
  margin-top: 20px;
  display: grid;
  place-items: center;
  padding: 0 52px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: linear-gradient(135deg, #C8102E, #E80732);
  border: none;
  border-radius: var(--senshi-radius-control);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.register-submit__label {
  display: block;
  width: 100%;
  text-align: center;
}

.register-submit.is-loading {
  pointer-events: none;
}

.register-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 24px rgba(232, 7, 50, 0.28);
}

.register-submit:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.register-submit:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}

.register-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: none;
  box-shadow: none;
  transform: none;
}

.register-submit__spinner {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: senshi-spin 0.7s linear infinite;
}

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

/* === Pie === */
.auth-card__footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 28px 42px 32px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 400;
  color: #707075;
  letter-spacing: 0.02em;
}

.auth-card__footer .dot {
  margin: 0 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* === Responsive === */
@media (max-width: 560px) {
  .auth-page {
    padding: 12px;
  }

  .auth-card {
    border-radius: 9px;
  }

  .auth-card__content {
    padding: 0 22px;
  }

  .back-link {
    margin-top: 18px;
  }

  .auth-header {
    margin-top: 16px;
  }

  .auth-header__title {
    font-size: 24px;
  }

  .field {
    height: 58px;
  }

  .strength__list {
    grid-template-columns: 1fr;
  }

  .auth-card__footer {
    padding: 24px 22px 26px;
  }
}

@media (max-height: 820px) {
  .back-link {
    margin-top: 16px;
  }

  .auth-header {
    margin-top: 14px;
  }

  .auth-header__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
  }

  .register-progress {
    margin-top: 16px;
  }

  .register-form {
    margin-top: 18px;
  }

  .auth-card__footer {
    padding: 18px 42px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Registro con código de acceso (2026-11-09) */
.register-hint { margin: -4px 0 0; font-size: 12px; line-height: 1.4; color: rgba(255,255,255,.62); }
