/* ═══════════════════════════════════════════════════════════════════
   Auth modal — rediseño tema claro / oscuro
   Corrige overlay oscuro en tema claro y scroll innecesario en login.
   ═══════════════════════════════════════════════════════════════════ */

@keyframes auth-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes auth-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Layout: sin scroll en login / recuperar corto ── */
#auth-modal .modal-card-auth {
  max-height: none;
  overflow: visible;
  width: min(480px, calc(100vw - 1.5rem));
}

#auth-modal .modal-card-auth:has(#form-register),
#auth-modal .modal-card-auth:has(#form-recover-complete) {
  width: min(820px, calc(100vw - 1.5rem));
  max-height: min(92vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#auth-modal #auth-content:has(#form-register),
#auth-modal #auth-content:has(#form-recover-complete) {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
  scrollbar-gutter: stable;
}

#auth-modal .register-section--kind {
  margin-top: 0;
}

#auth-modal.modal {
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  animation: auth-fade-in 0.28s ease both;
}

#auth-modal .modal-card-auth {
  animation: auth-slide-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ═══════════════════════════════════════════════════════════════════
   TEMA CLARO
   ═══════════════════════════════════════════════════════════════════ */

body:not([data-theme="dark"]) #auth-modal.modal {
  background:
    radial-gradient(circle at 20% 18%, rgba(var(--primary-rgb), 0.12), transparent 42%),
    radial-gradient(circle at 80% 82%, rgba(var(--primary-mid-rgb), 0.1), transparent 38%),
    rgba(248, 252, 255, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

body:not([data-theme="dark"]) #auth-modal .modal-card-auth {
  position: relative;
  isolation: isolate;
  padding: clamp(1.15rem, 2.8vw, 1.5rem);
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--line));
  background: #ffffff;
  color: var(--text-main, var(--text));
  box-shadow:
    0 24px 48px rgba(7, 30, 61, 0.12),
    0 2px 8px rgba(7, 30, 61, 0.06);
}

body:not([data-theme="dark"]) #auth-modal .modal-card-auth::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-mid, #83bee9));
  pointer-events: none;
  opacity: 1;
  mask-image: none;
  -webkit-mask-image: none;
  animation: none;
}

body:not([data-theme="dark"]) #auth-modal .modal-card-auth::after {
  display: none;
}

body:not([data-theme="dark"]) #auth-modal .modal-head {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.75rem;
  padding: 0 0 1rem;
  margin-bottom: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

body:not([data-theme="dark"]) #auth-modal .auth-modal-title-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}

body:not([data-theme="dark"]) #auth-modal .auth-modal-brand-logo {
  display: block;
  height: 48px;
  max-width: 160px;
  margin: 0;
  flex-shrink: 0;
  filter: none;
}

body:not([data-theme="dark"]) #auth-modal .auth-modal-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--text-main, var(--text));
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: none;
}

body:not([data-theme="dark"]) #auth-modal .auth-modal-heading-icon {
  display: none;
}

body:not([data-theme="dark"]) #auth-modal .auth-modal-heading-text {
  color: var(--text-main, var(--text));
  text-align: left;
}

body:not([data-theme="dark"]) #auth-modal .auth-modal-subtitle {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-soft, var(--muted));
  line-height: 1.35;
}

body:not([data-theme="dark"]) #auth-modal .modal-head .module-panel-btn--close {
  position: static;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--text-soft, var(--muted));
  background: #f1f5f9;
  border: 1px solid var(--line);
  box-shadow: none;
}

body:not([data-theme="dark"]) #auth-modal .modal-head .module-panel-btn--close:hover {
  background: #e8f0f8;
  color: var(--primary);
}

body:not([data-theme="dark"]) #auth-modal .tabs {
  margin: 0 0 1rem;
  padding: 0.28rem;
  gap: 0.25rem;
  max-width: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f4f8fc;
  box-shadow: none;
}

body:not([data-theme="dark"]) #auth-modal .tab {
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text-soft, var(--muted));
  min-height: 2.5rem;
  font-weight: 600;
  font-size: 0.88rem;
}

body:not([data-theme="dark"]) #auth-modal .tab:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  transform: none;
}

body:not([data-theme="dark"]) #auth-modal .tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #4a8fd4, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.22);
}

body:not([data-theme="dark"]) #auth-modal,
body:not([data-theme="dark"]) #auth-modal label,
body:not([data-theme="dark"]) #auth-modal .field-label,
body:not([data-theme="dark"]) #auth-modal .auth-plain-label,
body:not([data-theme="dark"]) #auth-modal .register-kind-label,
body:not([data-theme="dark"]) #auth-modal .register-terms-title,
body:not([data-theme="dark"]) #auth-modal .auth-header-premium h3 {
  color: var(--text-main, var(--text));
}

body:not([data-theme="dark"]) #auth-modal .muted,
body:not([data-theme="dark"]) #auth-modal small.muted {
  color: var(--text-soft, var(--muted));
}

body:not([data-theme="dark"]) #auth-modal a {
  color: var(--primary);
}

body:not([data-theme="dark"]) #auth-modal .auth-pane,
body:not([data-theme="dark"]) #auth-modal #form-login.auth-pane {
  gap: 0.85rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body:not([data-theme="dark"]) #auth-modal #form-login.auth-pane::before {
  display: none;
}

body:not([data-theme="dark"]) #auth-modal .auth-field-stack,
body:not([data-theme="dark"]) #auth-modal #form-login .auth-field-stack {
  gap: 0.38rem;
  padding: 0;
  border: 0;
  background: transparent;
}

body:not([data-theme="dark"]) #auth-modal #form-login .auth-plain-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main, var(--text));
  padding-inline: 0;
}

body:not([data-theme="dark"]) #auth-modal .auth-input-row,
body:not([data-theme="dark"]) #auth-modal #form-login .auth-input-row {
  min-height: 2.85rem;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line));
  box-shadow: 0 1px 2px rgba(7, 30, 61, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body:not([data-theme="dark"]) #auth-modal .auth-input-row:hover,
body:not([data-theme="dark"]) #auth-modal #form-login .auth-input-row:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  transform: none;
  box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.08);
}

body:not([data-theme="dark"]) #auth-modal .auth-input-row:focus-within,
body:not([data-theme="dark"]) #auth-modal #form-login .auth-input-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

body:not([data-theme="dark"]) #auth-modal .auth-input-prefix,
body:not([data-theme="dark"]) #auth-modal #form-login .auth-input-prefix {
  min-width: 2.75rem;
  border-radius: 0;
  color: var(--primary);
  background: transparent;
  border-right: 1px solid color-mix(in srgb, var(--primary) 10%, var(--line));
}

body:not([data-theme="dark"]) #auth-modal .auth-input-row .auth-input-control {
  background: transparent;
  border: 0;
  color: var(--text-main, var(--text));
  font-size: 0.94rem;
}

body:not([data-theme="dark"]) #auth-modal input:not([type="checkbox"]):not([type="radio"]):not(.auth-input-control),
body:not([data-theme="dark"]) #auth-modal select,
body:not([data-theme="dark"]) #auth-modal textarea {
  color: var(--text-main, var(--text));
  background: #ffffff;
  border: 1px solid var(--line);
}

body:not([data-theme="dark"]) #auth-modal .auth-password-row .btn,
body:not([data-theme="dark"]) #auth-modal .password-field .btn,
body:not([data-theme="dark"]) #auth-modal #form-login .auth-password-row .btn {
  min-height: 2.85rem;
  border-radius: 11px;
  padding-inline: 0.85rem;
  color: var(--primary);
  background: #f4f8fc;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line));
  font-size: 0.82rem;
  font-weight: 600;
}

body:not([data-theme="dark"]) #auth-modal .auth-password-row .btn:hover,
body:not([data-theme="dark"]) #auth-modal .password-field .btn:hover {
  background: #eaf3fb;
  color: var(--primary-dark);
}

body:not([data-theme="dark"]) #auth-modal .auth-remember-row,
body:not([data-theme="dark"]) #auth-modal #form-login .auth-remember-row {
  gap: 0.3rem;
  padding: 0.75rem 0.85rem;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

body:not([data-theme="dark"]) #auth-modal .auth-remember-check span {
  color: var(--text-main, var(--text));
  font-size: 0.88rem;
}

body:not([data-theme="dark"]) #auth-modal .auth-remember-check input {
  accent-color: var(--primary);
}

body:not([data-theme="dark"]) #auth-modal .btn-primary.full,
body:not([data-theme="dark"]) #auth-modal #form-login .btn-primary.full {
  min-height: 2.95rem;
  margin-top: 0.15rem;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #4a8fd4, var(--primary), var(--primary-dark));
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.22);
}

body:not([data-theme="dark"]) #auth-modal .btn-primary.full:hover,
body:not([data-theme="dark"]) #auth-modal #form-login .btn-primary.full:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(var(--primary-rgb), 0.28);
}

body:not([data-theme="dark"]) #auth-modal .auth-login-welcome {
  margin: 0 0 0.15rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

body:not([data-theme="dark"]) #auth-modal .auth-login-welcome h3 {
  margin: 0 0 0.25rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-main, var(--text));
}

body:not([data-theme="dark"]) #auth-modal .auth-login-welcome p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft, var(--muted));
  line-height: 1.4;
}

body:not([data-theme="dark"]) #auth-modal .auth-header-premium {
  margin-bottom: 0.5rem;
}

body:not([data-theme="dark"]) #auth-modal .register-kind-option {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--text-main, var(--text));
}

body:not([data-theme="dark"]) #auth-modal .register-terms-card,
body:not([data-theme="dark"]) #auth-modal .auth-inline-note,
body:not([data-theme="dark"]) #auth-modal .password-strength-suite,
body:not([data-theme="dark"]) #auth-modal .auth-recover-hint {
  background: #f8fafc;
  border-color: var(--line);
}

body:not([data-theme="dark"]) #auth-modal .phone-input-professional {
  background: #ffffff;
  border: 1px solid var(--line);
}

body:not([data-theme="dark"]) #auth-modal .cf-turnstile {
  border-radius: 11px;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   TEMA OSCURO
   ═══════════════════════════════════════════════════════════════════ */

body[data-theme="dark"] #auth-modal.modal {
  background:
    radial-gradient(circle at 16% 14%, rgba(131, 190, 233, 0.22), transparent 30%),
    radial-gradient(circle at 84% 86%, rgba(45, 106, 168, 0.24), transparent 34%),
    rgba(4, 14, 28, 0.88);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

body[data-theme="dark"] #auth-modal .modal-card-auth {
  position: relative;
  isolation: isolate;
  padding: clamp(1.15rem, 2.8vw, 1.5rem);
  border-radius: 20px;
  border: 1px solid rgba(148, 196, 255, 0.2);
  background: linear-gradient(155deg, #142c4a 0%, #0c1e34 100%);
  color: #e8f2ff;
  box-shadow:
    0 32px 64px rgba(2, 10, 20, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

body[data-theme="dark"] #auth-modal .modal-card-auth::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #1d4f86, #377cc0, #83bee9);
  pointer-events: none;
  opacity: 1;
  mask-image: none;
  -webkit-mask-image: none;
  animation: none;
}

body[data-theme="dark"] #auth-modal .modal-card-auth::after {
  display: none;
}

body[data-theme="dark"] #auth-modal .modal-head {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.75rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal .auth-modal-title-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}

body[data-theme="dark"] #auth-modal .auth-modal-brand-logo {
  display: block;
  height: 44px;
  max-width: 150px;
  margin: 0;
  flex-shrink: 0;
  filter: brightness(1.15) saturate(0.9);
}

body[data-theme="dark"] #auth-modal .auth-modal-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #eef6ff;
  font-size: 1.05rem;
  font-weight: 700;
  text-shadow: none;
}

body[data-theme="dark"] #auth-modal .auth-modal-heading-icon {
  display: none;
}

body[data-theme="dark"] #auth-modal .auth-modal-heading-text {
  color: #eef6ff;
  text-align: left;
}

body[data-theme="dark"] #auth-modal .auth-modal-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(206, 226, 248, 0.72);
}

body[data-theme="dark"] #auth-modal .modal-head .module-panel-btn--close {
  position: static;
  flex-shrink: 0;
  border-radius: 10px;
  color: #d6e8ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 196, 255, 0.2);
  box-shadow: none;
}

body[data-theme="dark"] #auth-modal .modal-head .module-panel-btn--close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

body[data-theme="dark"] #auth-modal .tabs {
  margin: 0 0 1rem;
  padding: 0.28rem;
  gap: 0.25rem;
  max-width: none;
  border-radius: 12px;
  border: 1px solid rgba(148, 196, 255, 0.16);
  background: rgba(6, 20, 38, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] #auth-modal .tab {
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: rgba(214, 232, 255, 0.72);
  min-height: 2.5rem;
  font-weight: 600;
  font-size: 0.88rem;
}

body[data-theme="dark"] #auth-modal .tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  transform: none;
}

body[data-theme="dark"] #auth-modal .tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #4a8fd4, #377cc0, #1e4a73);
  box-shadow: 0 4px 14px rgba(13, 55, 102, 0.4);
}

body[data-theme="dark"] #auth-modal,
body[data-theme="dark"] #auth-modal label,
body[data-theme="dark"] #auth-modal .field-label,
body[data-theme="dark"] #auth-modal .auth-plain-label,
body[data-theme="dark"] #auth-modal .register-kind-label,
body[data-theme="dark"] #auth-modal .register-terms-title,
body[data-theme="dark"] #auth-modal .auth-header-premium h3 {
  color: #e3eefc;
}

body[data-theme="dark"] #auth-modal .muted,
body[data-theme="dark"] #auth-modal small.muted {
  color: rgba(202, 223, 247, 0.72);
}

body[data-theme="dark"] #auth-modal a {
  color: #9ed0ff;
}

body[data-theme="dark"] #auth-modal .auth-pane,
body[data-theme="dark"] #auth-modal #form-login.auth-pane {
  gap: 0.85rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-theme="dark"] #auth-modal #form-login.auth-pane::before {
  display: none;
}

body[data-theme="dark"] #auth-modal .auth-field-stack,
body[data-theme="dark"] #auth-modal #form-login .auth-field-stack {
  gap: 0.38rem;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-theme="dark"] #auth-modal .auth-input-row,
body[data-theme="dark"] #auth-modal #form-login .auth-input-row {
  min-height: 2.85rem;
  border-radius: 11px;
  background: rgba(8, 22, 40, 0.72);
  border: 1px solid rgba(148, 196, 255, 0.2);
  box-shadow: none;
}

body[data-theme="dark"] #auth-modal .auth-input-row:hover,
body[data-theme="dark"] #auth-modal #form-login .auth-input-row:hover {
  border-color: rgba(131, 190, 233, 0.45);
  transform: none;
}

body[data-theme="dark"] #auth-modal .auth-input-row:focus-within,
body[data-theme="dark"] #auth-modal #form-login .auth-input-row:focus-within {
  border-color: rgba(131, 190, 233, 0.75);
  box-shadow: 0 0 0 3px rgba(131, 190, 233, 0.18);
}

body[data-theme="dark"] #auth-modal .auth-input-prefix,
body[data-theme="dark"] #auth-modal #form-login .auth-input-prefix {
  min-width: 2.75rem;
  border-radius: 0;
  color: #9ed0ff;
  background: transparent;
  border-right: 1px solid rgba(148, 196, 255, 0.16);
}

body[data-theme="dark"] #auth-modal .auth-input-row .auth-input-control {
  background: transparent;
  border: 0;
  color: #eaf3ff;
}

body[data-theme="dark"] #auth-modal input:not([type="checkbox"]):not([type="radio"]):not(.auth-input-control),
body[data-theme="dark"] #auth-modal select,
body[data-theme="dark"] #auth-modal textarea {
  color: #eaf3ff;
  background: rgba(8, 22, 40, 0.62);
  border: 1px solid rgba(148, 196, 255, 0.22);
}

body[data-theme="dark"] #auth-modal .auth-password-row .btn,
body[data-theme="dark"] #auth-modal .password-field .btn,
body[data-theme="dark"] #auth-modal #form-login .auth-password-row .btn {
  min-height: 2.85rem;
  border-radius: 11px;
  color: #d6e8ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 196, 255, 0.2);
}

body[data-theme="dark"] #auth-modal .auth-password-row .btn:hover,
body[data-theme="dark"] #auth-modal .password-field .btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

body[data-theme="dark"] #auth-modal .auth-remember-row,
body[data-theme="dark"] #auth-modal #form-login .auth-remember-row {
  gap: 0.3rem;
  padding: 0.75rem 0.85rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal .auth-remember-check span {
  color: #e3eefc;
  font-size: 0.88rem;
}

body[data-theme="dark"] #auth-modal .btn-primary.full,
body[data-theme="dark"] #auth-modal #form-login .btn-primary.full {
  min-height: 2.95rem;
  margin-top: 0.15rem;
  border-radius: 11px;
  background: linear-gradient(135deg, #59a5eb, #377cc0, #1e4a73);
  box-shadow: 0 10px 24px rgba(13, 55, 102, 0.4);
}

body[data-theme="dark"] #auth-modal .auth-login-welcome h3 {
  margin: 0 0 0.25rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: #eef6ff;
}

body[data-theme="dark"] #auth-modal .auth-login-welcome p {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(206, 226, 248, 0.72);
}

body[data-theme="dark"] #auth-modal .auth-login-welcome {
  margin: 0 0 0.15rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid rgba(148, 196, 255, 0.12);
}

body[data-theme="dark"] #auth-modal .register-kind-option {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 196, 255, 0.2);
  color: #e3eefc;
}

body[data-theme="dark"] #auth-modal .register-terms-card,
body[data-theme="dark"] #auth-modal .auth-inline-note,
body[data-theme="dark"] #auth-modal .password-strength-suite,
body[data-theme="dark"] #auth-modal .auth-recover-hint {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal .phone-input-professional {
  background: rgba(8, 22, 40, 0.6);
  border: 1px solid rgba(148, 196, 255, 0.22);
}

body[data-theme="dark"] #auth-modal .cf-turnstile {
  border-radius: 11px;
  overflow: hidden;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  #auth-modal.modal {
    align-items: center;
    overflow-y: auto;
    padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(0.5rem, env(safe-area-inset-right, 0px))
      max(0.5rem, env(safe-area-inset-bottom, 0px)) max(0.5rem, env(safe-area-inset-left, 0px));
  }

  #auth-modal .modal-card-auth {
    width: 100%;
    max-width: 100%;
  }

  body:not([data-theme="dark"]) #auth-modal .auth-modal-title-wrap,
  body[data-theme="dark"] #auth-modal .auth-modal-title-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  body:not([data-theme="dark"]) #auth-modal .auth-modal-brand-logo,
  body[data-theme="dark"] #auth-modal .auth-modal-brand-logo {
    height: 40px;
  }

  #auth-modal .auth-password-row {
    flex-wrap: wrap;
  }

  #auth-modal .auth-password-row .auth-input-row {
    flex: 1 1 100%;
  }

  #auth-modal .auth-password-row .btn {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #auth-modal.modal,
  #auth-modal .modal-card-auth {
    animation: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Formulario de registro — secciones, grid y controles
   Solo presentación; nombres, ids y estructura de campos intactos.
   ═══════════════════════════════════════════════════════════════════ */

#auth-modal #form-register.auth-register-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  gap: 0.65rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#auth-modal #form-register.auth-register-form::before {
  display: none;
}

#auth-modal .register-intro {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.55rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

#auth-modal #auth-content {
  overflow-y: visible;
  overflow-x: hidden;
  flex: 0 1 auto;
  min-height: 0;
  margin-top: 0;
  padding: 0;
}

#auth-modal .register-intro h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

#auth-modal .register-intro .muted {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

#auth-modal .register-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  align-self: stretch;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 10%, var(--line));
  background: color-mix(in srgb, var(--primary) 3%, #ffffff);
}

#auth-modal .register-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

#auth-modal .register-section-head--compact {
  margin-bottom: 0.1rem;
}

#auth-modal .register-section-step {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  background: linear-gradient(135deg, #4a8fd4, var(--primary));
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.22);
}

#auth-modal .register-section-step--icon {
  font-size: 0.65rem;
}

#auth-modal .register-section-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

#auth-modal .register-section-desc {
  margin: 0.12rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

#auth-modal .register-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: start;
  width: 100%;
}

#auth-modal .register-section-grid > .full,
#auth-modal .register-section-grid > .register-doc-section,
#auth-modal .register-section-grid > .password-strength-suite {
  grid-column: 1 / -1;
}

#auth-modal #form-register .register-section-grid > label,
#auth-modal #form-register .register-section-grid .register-doc-section > label,
#auth-modal #form-register .register-section-grid #register-doc-persona.register-doc-block--natural > label,
#auth-modal #form-register .register-section-grid #register-doc-empresa.register-doc-block--empresa > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
}

#auth-modal #form-register .field-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: inherit;
}

#auth-modal #form-register.auth-register-form {
  --reg-control-h: 2.65rem;
}

#auth-modal #form-register.auth-register-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.phone-national-input),
#auth-modal #form-register.auth-register-form select:not(.phone-cc-select),
#auth-modal #form-register.auth-register-form .phone-input-professional,
#auth-modal #form-register.auth-register-form .password-field .auth-password-input {
  min-height: var(--reg-control-h);
  height: var(--reg-control-h);
  box-sizing: border-box;
  width: 100%;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 10%, var(--line));
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#auth-modal #form-register.auth-register-form input[type="radio"],
#auth-modal #form-register.auth-register-form input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  min-width: 0;
  margin: 0;
  flex-shrink: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
}

#auth-modal #form-register.auth-register-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.phone-national-input):focus,
#auth-modal #form-register.auth-register-form select:not(.phone-cc-select):focus,
#auth-modal #form-register.auth-register-form .phone-input-professional:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
  outline: none;
}

#auth-modal #form-register.auth-register-form .password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: stretch;
  width: 100%;
}

#auth-modal #form-register.auth-register-form .password-field .btn {
  min-height: var(--reg-control-h);
  border-radius: 10px;
  padding-inline: 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

#auth-modal #form-register .register-kind-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

#auth-modal #form-register .register-kind-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

#auth-modal #form-register .register-kind-option {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: start;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  margin: 0;
  min-width: 0;
  width: 100%;
  overflow: visible;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--primary) 14%, var(--line));
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  word-break: normal;
  overflow-wrap: anywhere;
}

#auth-modal #form-register .register-kind-option:hover {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.08);
}

#auth-modal #form-register .register-kind-option:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, #ffffff);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

#auth-modal #form-register .register-kind-option input[type="radio"] {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 0.12rem;
  accent-color: var(--primary);
}

#auth-modal #form-register .register-kind-option-text {
  grid-column: 2;
  display: block;
  min-width: 0;
  width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}

#auth-modal #form-register .register-kind-option-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

#auth-modal #form-register .register-kind-option-text small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-soft, var(--muted));
}

#auth-modal #form-register .register-doc-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--primary) 18%, var(--line));
  background: rgba(var(--primary-rgb), 0.04);
}

#auth-modal #form-register .register-field-person-type {
  grid-column: 1 / -1;
}

#auth-modal #form-register #register-doc-persona.register-doc-block--natural {
  display: contents;
}

#auth-modal #form-register #register-doc-persona.register-doc-block--natural[hidden] {
  display: none !important;
}

#auth-modal #form-register #register-doc-empresa.register-doc-block--empresa {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

#auth-modal #form-register #register-doc-empresa.register-doc-block--empresa[hidden] {
  display: none !important;
}

#auth-modal #form-register .register-doc-empresa-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  background: rgba(var(--primary-rgb), 0.06);
}

#auth-modal #form-register .phone-input-professional {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
  background: #ffffff;
}

#auth-modal #form-register .phone-input-professional .phone-reg-flag-slot {
  border-right: 1px solid var(--line);
}

#auth-modal #form-register .phone-field-hint {
  font-size: 0.76rem;
}

#auth-modal #form-register .register-section--security .password-strength-suite {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

#auth-modal #form-register .register-section--legal {
  gap: 0.5rem;
  background: transparent;
  border: 0;
  padding: 0;
}

#auth-modal #form-register .register-terms-card {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fcff, #f3f9ff);
}

#auth-modal #form-register .register-terms-check {
  justify-content: flex-start;
  text-align: left;
  font-size: 0.86rem;
  line-height: 1.4;
}

#auth-modal #form-register .auth-inline-note {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line));
  background: rgba(var(--primary-rgb), 0.05);
}

#auth-modal #form-register .auth-inline-note .muted {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

#auth-modal #form-register .register-submit-wrap {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 0.15rem;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, #ffffff 88%, transparent) 24%);
}

#auth-modal #form-register .register-submit-btn {
  min-height: 3rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.24);
}

#auth-modal #form-register .register-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(var(--primary-rgb), 0.3);
}

#auth-modal #form-register input.auth-password-input.password-match-ok {
  border-color: #2d9d62 !important;
  box-shadow: 0 0 0 3px rgba(45, 157, 98, 0.14) !important;
}

#auth-modal #form-register input.auth-password-input.password-match-bad {
  border-color: #d64545 !important;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.12) !important;
}

/* Tema claro — registro */
body:not([data-theme="dark"]) #auth-modal .register-section {
  background: #fafcfe;
  border-color: color-mix(in srgb, var(--primary) 10%, var(--line));
}

body:not([data-theme="dark"]) #auth-modal .register-intro h3 {
  color: var(--text-main, var(--text));
}

body:not([data-theme="dark"]) #auth-modal #form-register.auth-register-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.phone-national-input),
body:not([data-theme="dark"]) #auth-modal #form-register.auth-register-form select:not(.phone-cc-select) {
  background: #ffffff;
  color: var(--text-main, var(--text));
}

body:not([data-theme="dark"]) #auth-modal #form-register .password-field .btn {
  color: var(--primary);
  background: #f4f8fc;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line));
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-kind-option-text strong {
  color: var(--text-main, var(--text));
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-section--security .password-strength-suite {
  background: #f8fafc;
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-submit-wrap {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.92) 28%);
}

/* Tema oscuro — registro */
body[data-theme="dark"] #auth-modal .register-intro {
  border-bottom-color: rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal .register-intro h3 {
  color: #eef6ff;
}

body[data-theme="dark"] #auth-modal .register-section {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal .register-section-title {
  color: #eef6ff;
}

body[data-theme="dark"] #auth-modal .register-section-desc {
  color: rgba(206, 226, 248, 0.72);
}

body[data-theme="dark"] #auth-modal #form-register .register-kind-option {
  background: rgba(8, 22, 40, 0.55);
  border-color: rgba(148, 196, 255, 0.18);
}

body[data-theme="dark"] #auth-modal #form-register .register-kind-option:has(input:checked) {
  background: rgba(var(--primary-rgb), 0.14);
  border-color: rgba(131, 190, 233, 0.55);
}

body[data-theme="dark"] #auth-modal #form-register .register-kind-option-text strong {
  color: #e3eefc;
}

body[data-theme="dark"] #auth-modal #form-register .register-kind-option-text small {
  color: rgba(202, 223, 247, 0.68);
}

body[data-theme="dark"] #auth-modal #form-register .register-doc-section {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(148, 196, 255, 0.16);
}

body[data-theme="dark"] #auth-modal #form-register .register-doc-empresa-note {
  background: rgba(131, 190, 233, 0.08);
  color: rgba(202, 223, 247, 0.72);
}

body[data-theme="dark"] #auth-modal #form-register.auth-register-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.phone-national-input),
body[data-theme="dark"] #auth-modal #form-register.auth-register-form select:not(.phone-cc-select) {
  background: rgba(8, 22, 40, 0.72);
  border-color: rgba(148, 196, 255, 0.18);
  color: #eaf3ff;
}

body[data-theme="dark"] #auth-modal #form-register .phone-input-professional {
  background: rgba(8, 22, 40, 0.72);
  border-color: rgba(148, 196, 255, 0.18);
}

body[data-theme="dark"] #auth-modal #form-register .password-field .btn {
  color: #d6e8ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 196, 255, 0.2);
}

body[data-theme="dark"] #auth-modal #form-register .register-section--security .password-strength-suite {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal #form-register .password-strength-headline {
  color: #eaf3ff;
}

body[data-theme="dark"] #auth-modal #form-register .password-rule-grid li {
  color: rgba(206, 226, 248, 0.78);
}

body[data-theme="dark"] #auth-modal #form-register .register-terms-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal #form-register .register-terms-title {
  color: #eef6ff;
}

body[data-theme="dark"] #auth-modal #form-register .auth-inline-note {
  background: rgba(131, 190, 233, 0.08);
  border-color: rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal #form-register .register-submit-wrap {
  background: linear-gradient(180deg, transparent, rgba(12, 27, 44, 0.95) 30%);
}

@media (max-width: 640px) {
  #auth-modal .register-section-grid,
  #auth-modal #form-register .register-doc-section,
  #auth-modal #form-register #register-doc-empresa.register-doc-block--empresa {
    grid-template-columns: 1fr;
  }

  #auth-modal #form-register .register-kind-options {
    grid-template-columns: 1fr;
  }

  #auth-modal .register-section {
    padding: 0.8rem 0.85rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Override estilos legacy (bloque "inmersivo" en styles.css)
   Registro + Recuperar — textos legibles en tema claro y oscuro
   ═══════════════════════════════════════════════════════════════════ */

#auth-modal .modal-card-auth:has(#form-recover) {
  width: min(520px, calc(100vw - 1.5rem));
  max-height: none;
  overflow: visible;
}

#auth-modal #auth-content:has(#form-recover) {
  overflow-y: visible;
  flex: 0 1 auto;
}

/* ── TEMA CLARO: tipografía y colores ── */
body:not([data-theme="dark"]) #auth-modal,
body:not([data-theme="dark"]) #auth-modal label,
body:not([data-theme="dark"]) #auth-modal .field-label,
body:not([data-theme="dark"]) #auth-modal .auth-plain-label,
body:not([data-theme="dark"]) #auth-modal .register-section-title,
body:not([data-theme="dark"]) #auth-modal .register-terms-title,
body:not([data-theme="dark"]) #auth-modal .auth-header-premium h3,
body:not([data-theme="dark"]) #auth-modal .auth-recover-hint-title,
body:not([data-theme="dark"]) #auth-modal .password-strength-headline,
body:not([data-theme="dark"]) #auth-modal .register-terms-check {
  color: var(--text-main, var(--text, #0f172a));
}

body:not([data-theme="dark"]) #auth-modal .muted,
body:not([data-theme="dark"]) #auth-modal small.muted,
body:not([data-theme="dark"]) #auth-modal .register-section-desc,
body:not([data-theme="dark"]) #auth-modal .auth-header-premium .muted,
body:not([data-theme="dark"]) #auth-modal .register-doc-empresa-note,
body:not([data-theme="dark"]) #auth-modal .register-terms-copy,
body:not([data-theme="dark"]) #auth-modal .password-policy-hint,
body:not([data-theme="dark"]) #auth-modal .register-password-match-hint,
body:not([data-theme="dark"]) #auth-modal .phone-field-hint,
body:not([data-theme="dark"]) #auth-modal .auth-recover-hint-text,
body:not([data-theme="dark"]) #auth-modal .password-rule-grid li {
  color: var(--text-soft, var(--muted, #64748b));
}

body:not([data-theme="dark"]) #auth-modal a,
body:not([data-theme="dark"]) #auth-modal .register-terms-link {
  color: var(--primary);
}

body:not([data-theme="dark"]) #auth-modal strong {
  color: var(--text-main, var(--text, #0f172a));
  font-weight: 700;
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-kind-option-text strong {
  color: var(--text-main, var(--text, #0f172a));
}

/* Paneles: sin vidrio oscuro en claro */
body:not([data-theme="dark"]) #auth-modal .auth-pane,
body:not([data-theme="dark"]) #auth-modal #form-recover.auth-pane,
body:not([data-theme="dark"]) #auth-modal #form-recover-complete.auth-pane {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  gap: 0.85rem;
}

body:not([data-theme="dark"]) #auth-modal .auth-header-premium {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

body:not([data-theme="dark"]) #auth-modal .auth-header-premium h3 {
  color: var(--text-main, var(--text, #0f172a));
}

body:not([data-theme="dark"]) #auth-modal .auth-header-premium .muted {
  color: var(--text-soft, var(--muted, #64748b));
  line-height: 1.45;
}

/* Recuperar: campo de correo */
body:not([data-theme="dark"]) #auth-modal #form-recover .auth-field-stack {
  gap: 0.38rem;
  padding: 0;
  border: 0;
  background: transparent;
}

body:not([data-theme="dark"]) #auth-modal #form-recover .auth-plain-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main, var(--text, #0f172a));
}

body:not([data-theme="dark"]) #auth-modal #form-recover .auth-input-row {
  min-height: 2.85rem;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line));
  box-shadow: 0 1px 2px rgba(7, 30, 61, 0.04);
}

body:not([data-theme="dark"]) #auth-modal #form-recover .auth-input-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

body:not([data-theme="dark"]) #auth-modal #form-recover .auth-input-prefix {
  min-width: 2.75rem;
  color: var(--primary);
  background: transparent;
  border-right: 1px solid color-mix(in srgb, var(--primary) 10%, var(--line));
}

body:not([data-theme="dark"]) #auth-modal #form-recover .auth-input-control {
  background: transparent;
  border: 0;
  color: var(--text-main, var(--text, #0f172a));
  font-size: 0.94rem;
}

body:not([data-theme="dark"]) #auth-modal #form-recover .auth-input-control::placeholder {
  color: var(--text-soft, #94a3b8);
}

/* Recuperar: caja informativa */
body:not([data-theme="dark"]) #auth-modal .auth-recover-hint {
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  background: linear-gradient(135deg, #f5faff 0%, #f0f7ff 100%);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.06);
}

body:not([data-theme="dark"]) #auth-modal .auth-recover-hint-inner {
  border-left-color: var(--primary);
}

body:not([data-theme="dark"]) #auth-modal .auth-recover-hint-icon {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--primary) 16%, var(--line));
}

body:not([data-theme="dark"]) #auth-modal .auth-recover-hint-title {
  color: var(--text-main, var(--text, #0f172a));
}

body:not([data-theme="dark"]) #auth-modal .auth-recover-hint-text {
  color: var(--text-soft, var(--muted, #64748b));
}

body:not([data-theme="dark"]) #auth-modal #form-recover .auth-recover-submit {
  min-height: 2.95rem;
  border-radius: 11px;
  font-weight: 700;
}

/* Registro: medidor de contraseña y términos */
body:not([data-theme="dark"]) #auth-modal #form-register .password-strength-suite {
  background: #f8fafc;
  border-color: var(--line);
}

body:not([data-theme="dark"]) #auth-modal #form-register .password-strength-headline {
  color: var(--text-main, var(--text, #0f172a));
}

body:not([data-theme="dark"]) #auth-modal #form-register .password-rule-grid li {
  color: var(--text-soft, var(--muted, #64748b));
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-terms-card {
  background: linear-gradient(180deg, #f9fcff, #f3f9ff);
  border-color: var(--line);
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-terms-title {
  color: var(--text-main, var(--text, #0f172a));
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-terms-copy,
body:not([data-theme="dark"]) #auth-modal #form-register .register-terms-check {
  color: var(--text-soft, var(--muted, #64748b));
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-section-title {
  color: var(--text-main, var(--text, #0f172a));
}

body:not([data-theme="dark"]) #auth-modal #form-register .register-section-desc {
  color: var(--text-soft, var(--muted, #64748b));
}

/* Inputs registro — excluir radios (ya corregidos arriba) */
body:not([data-theme="dark"]) #auth-modal #form-register input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.phone-national-input),
body:not([data-theme="dark"]) #auth-modal #form-register select:not(.phone-cc-select) {
  color: var(--text-main, var(--text, #0f172a));
  background: #ffffff;
}

body:not([data-theme="dark"]) #auth-modal #form-register input::placeholder {
  color: #94a3b8;
}

/* ── TEMA OSCURO: registro + recuperar ── */
body[data-theme="dark"] #auth-modal .auth-header-premium h3,
body[data-theme="dark"] #auth-modal .register-section-title,
body[data-theme="dark"] #auth-modal .register-terms-title,
body[data-theme="dark"] #auth-modal .auth-recover-hint-title,
body[data-theme="dark"] #auth-modal .password-strength-headline,
body[data-theme="dark"] #auth-modal #form-recover .auth-plain-label {
  color: #eef6ff;
}

body[data-theme="dark"] #auth-modal .auth-header-premium .muted,
body[data-theme="dark"] #auth-modal .register-section-desc,
body[data-theme="dark"] #auth-modal .auth-recover-hint-text,
body[data-theme="dark"] #auth-modal .register-terms-copy,
body[data-theme="dark"] #auth-modal .password-rule-grid li,
body[data-theme="dark"] #auth-modal .register-doc-empresa-note,
body[data-theme="dark"] #auth-modal .phone-field-hint,
body[data-theme="dark"] #auth-modal .password-policy-hint,
body[data-theme="dark"] #auth-modal .register-password-match-hint {
  color: rgba(206, 226, 248, 0.78);
}

body[data-theme="dark"] #auth-modal .auth-pane,
body[data-theme="dark"] #auth-modal #form-recover.auth-pane {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body[data-theme="dark"] #auth-modal .auth-header-premium {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(148, 196, 255, 0.14);
}

body[data-theme="dark"] #auth-modal #form-recover .auth-input-row {
  background: rgba(8, 22, 40, 0.72);
  border-color: rgba(148, 196, 255, 0.2);
}

body[data-theme="dark"] #auth-modal #form-recover .auth-input-control {
  color: #eaf3ff;
}

body[data-theme="dark"] #auth-modal #form-recover .auth-input-prefix {
  color: #9ed0ff;
  background: transparent;
  border-right-color: rgba(148, 196, 255, 0.16);
}

body[data-theme="dark"] #auth-modal .auth-recover-hint {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 196, 255, 0.16);
}

body[data-theme="dark"] #auth-modal .auth-recover-hint-icon {
  color: #9ed0ff;
  background: rgba(131, 190, 233, 0.12);
  border-color: rgba(148, 196, 255, 0.2);
}

body[data-theme="dark"] #auth-modal strong {
  color: #f0f7ff;
}

body[data-theme="dark"] #auth-modal a,
body[data-theme="dark"] #auth-modal .register-terms-link {
  color: #9ed0ff;
}
