/**
 * Onix Auth UI — layout compartido, stepper, tema teal #0bb8a8
 */
:root {
  --auth-teal: #0bb8a8;
  --auth-teal-dark: #099a8d;
  --auth-teal-light: #e6f7f5;
  --auth-teal-glow: rgba(11, 184, 168, 0.35);
  --auth-bg: #f0f4f8;
  --auth-surface: #ffffff;
  --auth-text: #1a2332;
  --auth-text-muted: #5c6b7a;
  --auth-border: #dde4ec;
  --auth-danger: #e63757;
  --auth-success: #00d27a;
  --auth-radius: 12px;
  --auth-radius-lg: 16px;
  --auth-shadow: 0 8px 32px rgba(26, 35, 50, 0.08);
  --auth-shadow-lg: 0 16px 48px rgba(26, 35, 50, 0.12);
  --auth-font: "Poppins", "Open Sans", system-ui, -apple-system, sans-serif;
  --auth-transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.auth-page {
  min-height: 100vh;
  margin: 0;
  font-family: var(--auth-font);
  font-size: 0.9375rem;
  color: var(--auth-text);
  background: var(--auth-bg);
  -webkit-font-smoothing: antialiased;
}

.auth-page a {
  color: var(--auth-teal-dark);
  text-decoration: none;
  transition: color var(--auth-transition);
}

.auth-page a:hover {
  color: var(--auth-teal);
  text-decoration: underline;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-shell--wide {
  align-items: flex-start;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* ── Card variants ── */
.auth-card {
  width: 100%;
  max-width: 920px;
  background: var(--auth-surface);
  border-radius: var(--auth-radius-lg);
  box-shadow: var(--auth-shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auth-card--centered {
  max-width: 480px;
}

.auth-card--selector {
  max-width: 720px;
}

.auth-card--wide {
  max-width: 1040px;
}

.auth-card__inner {
  display: flex;
  flex-direction: row;
  min-height: 420px;
}

.auth-card--centered .auth-card__inner,
.auth-card--selector .auth-card__inner {
  flex-direction: column;
  min-height: auto;
}

/* Hero (split) */
.auth-hero {
  flex: 0 0 42%;
  max-width: 42%;
  background: linear-gradient(145deg, var(--auth-teal-dark) 0%, var(--auth-teal) 55%, #0dd4c2 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.auth-hero__brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.auth-hero__brand:hover {
  color: #fff;
  text-decoration: none;
  opacity: 0.95;
}

.auth-hero__brand span {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.auth-page .auth-hero .auth-hero__brand,
.auth-page .auth-hero .auth-hero__brand:hover,
.auth-page .auth-hero .auth-hero__brand span {
  color: #ffffff;
}

.auth-hero__brand img {
  width: 48px;
  height: auto;
}

.auth-hero__text {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.92;
  margin: 0;
}

.auth-hero__visual {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
}

.auth-hero__visual img {
  max-width: 100%;
  height: auto;
  border-radius: var(--auth-radius);
}

/* Pane */
.auth-pane {
  flex: 1;
  padding: 2rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.auth-card--wide .auth-pane {
  justify-content: flex-start;
  max-height: none;
}

.auth-pane__header {
  margin-bottom: 1.5rem;
}

.auth-pane__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-pane__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--auth-text-muted);
}

/* Stepper */
.auth-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding: 0;
  list-style: none;
}

.auth-stepper__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.auth-stepper__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: var(--auth-border);
  z-index: 0;
}

.auth-stepper__item.is-done:not(:last-child)::after {
  background: var(--auth-teal);
}

.auth-stepper__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--auth-border);
  background: var(--auth-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--auth-text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--auth-transition);
}

.auth-stepper__item.is-active .auth-stepper__dot {
  border-color: var(--auth-teal);
  background: var(--auth-teal);
  color: #fff;
  box-shadow: 0 0 0 4px var(--auth-teal-glow);
}

.auth-stepper__item.is-done .auth-stepper__dot {
  border-color: var(--auth-teal);
  background: var(--auth-teal);
  color: #fff;
}

.auth-stepper__label {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--auth-text-muted);
  line-height: 1.2;
  max-width: 90px;
}

.auth-stepper__item.is-active .auth-stepper__label {
  color: var(--auth-teal-dark);
  font-weight: 600;
}

@media (max-width: 480px) {
  .auth-stepper__label {
    font-size: 0.625rem;
    max-width: 72px;
  }
}

/* Form */
.auth-form-pane .form-control,
.auth-form-pane .form-select,
.auth-form-pane input[type="text"],
.auth-form-pane input[type="email"],
.auth-form-pane input[type="password"],
.auth-form-pane input[type="tel"],
.auth-form-pane input[type="number"],
.auth-form-pane textarea,
.auth-form-pane select:not(.auth-select) {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-surface);
  color: var(--auth-text);
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-form-pane .form-control:focus,
.auth-form-pane input:focus,
.auth-form-pane select:focus,
.auth-form-pane textarea:focus {
  outline: none;
  border-color: var(--auth-teal);
  box-shadow: 0 0 0 3px var(--auth-teal-glow);
}

.auth-form-pane label,
.auth-form-pane .form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-text);
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.auth-field-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .auth-field-grid,
  .auth-field-grid--3 {
    grid-template-columns: 1fr;
  }
}

.auth-fieldset {
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 0 0 1.5rem;
}

.auth-fieldset__legend {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--auth-teal-dark);
  padding: 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Password field */
.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .form-control,
.auth-password-wrap input[type="password"] {
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--auth-text-muted);
  line-height: 1;
  border-radius: 6px;
}

.auth-password-toggle:hover {
  color: var(--auth-teal);
  background: var(--auth-teal-light);
}

.auth-strength {
  margin-top: 0.5rem;
}

.auth-strength__bar {
  height: 4px;
  border-radius: 2px;
  background: var(--auth-border);
  overflow: hidden;
}

.auth-strength__fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.auth-strength__fill[data-level="1"] {
  width: 25%;
  background: var(--auth-danger);
}
.auth-strength__fill[data-level="2"] {
  width: 50%;
  background: #f5803e;
}
.auth-strength__fill[data-level="3"] {
  width: 75%;
  background: #f4c22b;
}
.auth-strength__fill[data-level="4"] {
  width: 100%;
  background: var(--auth-success);
}

.auth-strength__label {
  font-size: 0.75rem;
  color: var(--auth-text-muted);
  margin-top: 0.25rem;
}

/* Alerts */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.auth-alert--danger {
  background: #fce8ec;
  color: #932338;
  border: 1px solid #f5c2cb;
}

.auth-alert--success {
  background: #e3faf0;
  color: #0a5c38;
  border: 1px solid #b8ebd4;
}

.auth-alert.is-hidden {
  display: none;
}

/* Buttons */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background var(--auth-transition), transform 0.1s ease, box-shadow var(--auth-transition);
  text-decoration: none;
}

.auth-btn--primary {
  background: var(--auth-teal);
  color: #fff;
}

.auth-btn--primary:hover:not(:disabled) {
  background: var(--auth-teal-dark);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px var(--auth-teal-glow);
}

.auth-btn--secondary {
  background: var(--auth-surface);
  color: var(--auth-text);
  border: 1px solid var(--auth-border);
}

.auth-btn--secondary:hover {
  border-color: var(--auth-teal);
  color: var(--auth-teal-dark);
  text-decoration: none;
}

.auth-btn--block {
  width: 100%;
}

.auth-btn:disabled,
.auth-btn.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  align-items: center;
  justify-content: center;
}

.auth-actions--between {
  justify-content: space-between;
}

/* Company selector grid */
.auth-company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.auth-company-card {
  position: relative;
  border: 2px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition), background var(--auth-transition);
  background: var(--auth-surface);
}

.auth-company-card:hover {
  border-color: var(--auth-teal);
  box-shadow: 0 4px 16px var(--auth-teal-glow);
}

.auth-company-card.is-selected {
  border-color: var(--auth-teal);
  background: var(--auth-teal-light);
  box-shadow: 0 0 0 3px var(--auth-teal-glow);
}

.auth-company-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-company-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  background: var(--auth-teal-light);
  color: var(--auth-teal-dark);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.auth-company-card__name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--auth-text);
  margin: 0;
  display: block;
}

.auth-page--portal-admin .auth-hero--admin {
  background: linear-gradient(160deg, #1e293b 0%, #334155 50%, #0f766e 100%);
}

.auth-card--login-sel .auth-company-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  color: var(--auth-teal);
  font-weight: 700;
}

.auth-company-card__badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--auth-teal-light);
  color: var(--auth-teal-dark);
}

/* Success screen */
.auth-success {
  text-align: center;
  padding: 2rem 1rem;
}

.auth-success__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--auth-teal-light);
  color: var(--auth-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.auth-success__title {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.auth-success__text {
  color: var(--auth-text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

/* Footer link */
.auth-footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--auth-text-muted);
}

/* Responsive */
@media (max-width: 991px) {
  .auth-card__inner {
    flex-direction: column;
    min-height: auto;
  }

  .auth-hero {
    flex: none;
    max-width: 100%;
    padding: 2rem 1.5rem;
  }

  .auth-pane {
    padding: 1.75rem 1.5rem;
  }
}

@media (max-width: 576px) {
  .auth-shell {
    padding: 0.75rem;
  }

  .auth-pane {
    padding: 1.5rem 1.25rem;
  }

  .auth-pane__title {
    font-size: 1.25rem;
  }
}

/* Legacy compat inside auth pages */
.auth-form-pane .btn-primary,
.auth-form-pane .bg-gradient-primary {
  background: var(--auth-teal) !important;
  border-color: var(--auth-teal) !important;
}

.auth-form-pane .btn-primary:hover {
  background: var(--auth-teal-dark) !important;
  border-color: var(--auth-teal-dark) !important;
}

.auth-form-pane hr {
  border: none;
  border-top: 1px solid var(--auth-border);
  margin: 1.25rem 0;
}

.auth-form-pane .text-gray-900,
.auth-form-pane .h4 {
  color: var(--auth-text);
}

.auth-form-pane .form-group {
  margin-bottom: 1rem;
}

/* ── Login sel: select + user chip ── */
.auth-select-wrap {
  position: relative;
  display: block;
}

.auth-select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--auth-teal-dark);
  pointer-events: none;
  z-index: 1;
}

.auth-form-pane .auth-select,
.auth-select {
  width: 100%;
  padding: 0.75rem 2.75rem 0.75rem 0.875rem;
  font-size: 0.9375rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--auth-text);
  background-color: var(--auth-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='%23099a8d' d='M7 9L0 0h14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-form-pane .auth-select:hover,
.auth-select:hover {
  border-color: var(--auth-teal);
}

.auth-form-pane .auth-select:focus,
.auth-select:focus {
  outline: none;
  border-color: var(--auth-teal);
  box-shadow: 0 0 0 3px var(--auth-teal-glow);
}

.auth-select option {
  font-weight: 500;
  padding: 0.5rem;
}

.auth-user-chip {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--auth-teal-light) 0%, #f8fbfc 100%);
  border: 1px solid rgba(11, 184, 168, 0.2);
  border-left: 4px solid var(--auth-teal);
  border-radius: var(--auth-radius);
}

.auth-user-chip__avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--auth-teal-dark), var(--auth-teal));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px var(--auth-teal-glow);
}

.auth-user-chip__body {
  min-width: 0;
}

.auth-user-chip__name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--auth-text);
  margin: 0 0 0.15rem;
}

.auth-user-chip__email {
  display: block;
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-business-active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
  padding: 0.625rem 0.875rem;
  background: var(--auth-surface);
  border: 1px dashed var(--auth-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  min-height: 2.5rem;
}

.auth-business-active.is-visible {
  border-style: solid;
  border-color: rgba(11, 184, 168, 0.35);
  background: var(--auth-teal-light);
  color: var(--auth-teal-dark);
}

.auth-business-active__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--auth-teal);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--auth-transition);
}

.auth-business-active.is-visible .auth-business-active__dot {
  opacity: 1;
}

.auth-business-active__label {
  font-weight: 600;
}

.auth-help {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  line-height: 1.45;
}

.auth-help::before {
  content: "ℹ ";
  opacity: 0.7;
}

.auth-field--select {
  margin-bottom: 0.25rem;
}

.auth-card--login-sel {
  max-width: 880px;
}

.auth-hero--welcome .auth-hero__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.auth-hero--welcome .auth-hero__icon svg {
  width: 36px;
  height: 36px;
  fill: #fff;
  opacity: 0.95;
}

.auth-hero--welcome .auth-hero__greeting {
  position: relative;
  z-index: 1;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff;
}

.auth-hero--welcome .auth-hero__text {
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Overlay bloqueo (envío formularios lentos) */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(26, 35, 50, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.auth-overlay-open {
  overflow: hidden;
}

.auth-overlay__panel {
  background: var(--auth-surface);
  border-radius: var(--auth-radius-lg);
  padding: 2rem 2.25rem;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: var(--auth-shadow-lg);
  animation: auth-overlay-in 0.35s ease;
}

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

.auth-overlay__spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.25rem;
  border: 4px solid var(--auth-teal-light);
  border-top-color: var(--auth-teal);
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
}

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

.auth-overlay__text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--auth-text);
  line-height: 1.45;
}

.auth-overlay__sub {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
}

/* ── Portal dark login (quick_link → login) ── */
.auth-page--portal-dark {
  background: #050505;
  color: var(--auth-text);
  position: relative;
  overflow-x: hidden;
}

.auth-page--portal-dark::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-size: 48px 48px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, black 15%, transparent 70%);
  z-index: 0;
}

.auth-page--portal-dark::after {
  content: "";
  position: fixed;
  top: -10%;
  right: -5%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.12), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.auth-page--portal-dark .auth-shell {
  position: relative;
  z-index: 1;
  flex-direction: column;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.auth-portal-topbar {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 1rem;
  padding: 0 0.25rem;
}

.auth-page--portal-dark .auth-shell > .auth-portal-topbar,
.auth-page--portal-client .auth-shell > .auth-portal-topbar,
.auth-page--portal-provider .auth-shell > .auth-portal-topbar {
  width: 100%;
  align-self: stretch;
}

.auth-page--portal-dark .auth-shell > .auth-card,
.auth-page--portal-client .auth-shell > .auth-card,
.auth-page--portal-provider .auth-shell > .auth-card {
  width: 100%;
}

.auth-page--portal-dark .auth-shell > .auth-card--centered,
.auth-page--portal-client .auth-shell > .auth-card--centered,
.auth-page--portal-provider .auth-shell > .auth-card--centered {
  width: 100%;
  max-width: 480px;
}

.auth-portal-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition: var(--auth-transition);
}

.auth-portal-topbar__link:hover {
  color: #e2e8f0;
  border-color: rgba(0, 240, 255, 0.35);
  text-decoration: none;
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
}

.auth-page--portal-dark .auth-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.auth-page--portal-dark .auth-hero--login {
  background: linear-gradient(145deg, #0a1628 0%, #4338ca 45%, #0bb8a8 100%);
}

.auth-page--portal-dark .auth-hero--login .auth-hero__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.auth-page--portal-dark .auth-hero--login .auth-hero__icon svg {
  width: 34px;
  height: 34px;
  fill: #fff;
}

.auth-page--portal-dark .auth-hero__brand span {
  font-family: "Orbitron", var(--auth-font);
  letter-spacing: 0.04em;
}

.auth-page--portal-dark .auth-pane__title {
  font-family: "Orbitron", var(--auth-font);
  letter-spacing: -0.02em;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap__icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-text-muted);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 2;
}

.auth-field--icon .form-control,
.auth-field--icon input[type="email"],
.auth-field--icon input[type="password"] {
  padding-left: 2.5rem;
}

.auth-input-wrap--password .auth-password-wrap input {
  padding-left: 2.5rem;
  padding-right: 2.75rem;
}

.auth-row-actions {
  display: flex;
  justify-content: flex-end;
  margin: -0.35rem 0 1rem;
}

.auth-link-muted {
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  text-decoration: none;
  transition: color var(--auth-transition);
}

.auth-link-muted:hover {
  color: var(--auth-teal-dark);
  text-decoration: underline;
}

.auth-btn--login {
  margin-top: 0.25rem;
  padding: 0.8rem 1.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #0bb8a8 100%);
  box-shadow: 0 8px 24px rgba(11, 184, 168, 0.25);
}

.auth-btn--login:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5 0%, #099a8d 100%);
  box-shadow: 0 10px 28px rgba(11, 184, 168, 0.35);
  transform: translateY(-1px);
}

.auth-register-hint {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--auth-text-muted);
}

.auth-register-hint a {
  font-weight: 600;
}

.auth-page--portal-dark .auth-footer-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn--login:hover:not(:disabled) {
    transform: none;
  }
}

/* ── Portal Clientes (acento naranja/ámbar — quick_link) ── */
.auth-page--portal-client {
  --ql-client-from: #f59e0b;
  --ql-client-to: #f97316;
  --ql-client-soft: #fff7ed;
  --auth-teal: var(--ql-client-from);
  --auth-teal-dark: #d97706;
  --auth-teal-light: var(--ql-client-soft);
  --auth-teal-glow: rgba(245, 158, 11, 0.35);
  background: #050505;
  color: var(--auth-text);
  position: relative;
  overflow-x: hidden;
}

.auth-page--portal-client::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-size: 48px 48px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, black 15%, transparent 70%);
  z-index: 0;
}

.auth-page--portal-client .auth-shell {
  position: relative;
  z-index: 1;
  flex-direction: column;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.auth-page--portal-client .auth-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.auth-page--portal-client .auth-hero--client {
  background: linear-gradient(135deg, var(--ql-client-from), var(--ql-client-to));
}

.auth-page--portal-client .auth-btn--login {
  background: linear-gradient(135deg, var(--ql-client-from), var(--ql-client-to));
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.auth-page--portal-client .auth-btn--login:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, var(--ql-client-from));
}

.auth-page--portal-client .auth-btn--primary {
  background: linear-gradient(135deg, var(--ql-client-from), var(--ql-client-to));
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.auth-page--portal-client .auth-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, var(--ql-client-from));
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.auth-page--portal-client .auth-btn--secondary:hover {
  border-color: var(--ql-client-from);
  color: var(--ql-client-from);
}

.auth-page--portal-client .auth-form-pane .form-control:focus,
.auth-page--portal-client .auth-form-pane input:focus,
.auth-page--portal-client .auth-form-pane select:focus,
.auth-page--portal-client .auth-form-pane textarea:focus {
  border-color: var(--ql-client-from);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.auth-page--portal-client .auth-pane a {
  color: var(--ql-client-from);
}

.auth-page--portal-client .auth-pane a:hover {
  color: var(--ql-client-to);
}

/* ── Portal Proveedores (acento verde) ── */
.auth-page--portal-provider {
  background: #050505;
  color: var(--auth-text);
  position: relative;
  overflow-x: hidden;
}

.auth-page--portal-provider::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-size: 48px 48px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, black 15%, transparent 70%);
  z-index: 0;
}

.auth-page--portal-provider .auth-shell {
  position: relative;
  z-index: 1;
  flex-direction: column;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.auth-page--portal-provider .auth-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.auth-page--portal-provider .auth-hero--provider {
  background: linear-gradient(145deg, #0d3321 0%, #198754 45%, #20c997 100%);
}

.auth-page--portal-provider .auth-btn--login {
  background: linear-gradient(135deg, #157347 0%, #20c997 100%);
  box-shadow: 0 8px 24px rgba(25, 135, 84, 0.3);
}

.auth-page--portal-provider .auth-btn--login:hover:not(:disabled) {
  background: linear-gradient(135deg, #0d5c38 0%, #157347 100%);
}

/* ── Google Sign-In ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--auth-text-muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-google-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-bottom: 0.5rem;
}

.auth-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 320px;
  min-height: 44px;
  padding: 0.55rem 1.25rem;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-google-btn:hover {
  background: #f8f9fa;
  border-color: #d2e3fc;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.auth-google-btn:focus-visible {
  outline: 2px solid #4285f4;
  outline-offset: 2px;
}

.auth-google-btn__icon {
  display: inline-flex;
  flex-shrink: 0;
}

.auth-google-wrap--loading {
  opacity: 0.6;
  pointer-events: none;
}

.auth-page--portal-dark .auth-divider::before,
.auth-page--portal-dark .auth-divider::after,
.auth-page--portal-client .auth-divider::before,
.auth-page--portal-client .auth-divider::after,
.auth-page--portal-provider .auth-divider::before,
.auth-page--portal-provider .auth-divider::after {
  background: rgba(255, 255, 255, 0.12);
}

.auth-page--portal-client .auth-portal-topbar__link:hover,
.auth-page--portal-provider .auth-portal-topbar__link:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.auth-page--portal-client .auth-portal-topbar__link,
.auth-page--portal-provider .auth-portal-topbar__link {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════════
   Auth UI v2 — login moderno clientes / proveedores
   ═══════════════════════════════════════════════════════════ */
.auth-page--login-v2 {
  --auth-font: "Inter", "Poppins", system-ui, sans-serif;
  font-family: var(--auth-font);
}

.auth-page--login-v2::after {
  content: "";
  position: fixed;
  bottom: -15%;
  left: -8%;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.auth-page--portal-client.auth-page--login-v2::after {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.45), transparent 70%);
}

.auth-page--portal-provider.auth-page--login-v2::after {
  background: radial-gradient(circle, rgba(32, 201, 151, 0.45), transparent 70%);
}

.auth-page--exit {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.auth-card--v2 {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 32px 80px rgba(0, 0, 0, 0.55);
  animation: auth-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.auth-card--v2 .auth-pane {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
}

.auth-card--v2 .auth-pane__title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-card--v2 .auth-pane__subtitle {
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-hero--login .auth-hero__icon svg,
.auth-hero--welcome .auth-hero__icon svg {
  width: 40px;
  height: 40px;
  stroke: #fff;
  fill: none;
}

.auth-page--portal-client .auth-hero--login .auth-hero__icon,
.auth-page--portal-provider .auth-hero--login .auth-hero__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 1.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.auth-hero__features {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.auth-hero__feature {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  opacity: 0.92;
  margin-bottom: 0.65rem;
}

.auth-hero__feature-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.auth-hero__feature-icon svg {
  width: 11px;
  height: 11px;
  stroke: #fff;
}

.auth-portal-topbar__icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.auth-portal-topbar__icon svg {
  width: 100%;
  height: 100%;
}

/* Floating labels + inputs v2 */
.auth-field--float {
  margin-bottom: 1.15rem;
}

.auth-field--float .auth-input-wrap {
  position: relative;
}

.auth-input-wrap__icon--svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  left: 1rem;
  color: var(--auth-text-muted);
  transition: color var(--auth-transition);
}

.auth-input-wrap__icon--svg svg {
  width: 100%;
  height: 100%;
}

.auth-field--float .auth-input {
  padding: 1.15rem 1rem 0.45rem 2.75rem;
  border-radius: 12px;
  border: 1.5px solid var(--auth-border);
  background: #f8fafc;
  font-size: 0.9375rem;
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition), background var(--auth-transition);
}

.auth-field--float .auth-input:focus {
  background: #fff;
  border-color: var(--auth-teal);
}

.auth-field--float:focus-within .auth-input-wrap__icon--svg {
  color: var(--auth-teal-dark);
}

.auth-float-label {
  position: absolute;
  left: 2.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--auth-text-muted);
  pointer-events: none;
  transition: all 0.18s ease;
  transform-origin: left center;
}

.auth-field--float .auth-input:focus ~ .auth-float-label,
.auth-field--float .auth-input:not(:placeholder-shown) ~ .auth-float-label {
  top: 0.55rem;
  transform: translateY(0) scale(0.78);
  color: var(--auth-teal-dark);
  font-weight: 600;
}

.auth-input-wrap--password .auth-float-label {
  left: 2.75rem;
}

.auth-input-wrap--password .auth-password-wrap input {
  padding: 1.15rem 2.75rem 0.45rem 2.75rem;
}

.auth-page--portal-client .auth-field--float .auth-input:focus {
  border-color: var(--ql-client-from);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.auth-page--portal-client .auth-field--float:focus-within .auth-input-wrap__icon--svg,
.auth-page--portal-client .auth-field--float .auth-input:focus ~ .auth-float-label,
.auth-page--portal-client .auth-field--float .auth-input:not(:placeholder-shown) ~ .auth-float-label {
  color: var(--ql-client-from);
}

.auth-page--portal-provider .auth-field--float .auth-input:focus {
  border-color: #198754;
  box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.12);
}

.auth-page--portal-provider .auth-field--float:focus-within .auth-input-wrap__icon--svg,
.auth-page--portal-provider .auth-field--float .auth-input:focus ~ .auth-float-label,
.auth-page--portal-provider .auth-field--float .auth-input:not(:placeholder-shown) ~ .auth-float-label {
  color: #157347;
}

/* Password toggle v2 */
.auth-password-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
}

.auth-password-toggle__hide {
  display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle__show {
  display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle__hide {
  display: block;
}

/* Button v2 */
.auth-btn--login {
  position: relative;
  overflow: hidden;
  min-height: 48px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-btn__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.auth-btn__icon svg {
  width: 100%;
  height: 100%;
}

.auth-btn__spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.65s linear infinite;
}

.auth-btn.is-loading .auth-btn__icon,
.auth-btn.is-loading .auth-btn__text {
  opacity: 0;
}

.auth-btn.is-loading .auth-btn__spinner {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -10px 0 0 -10px;
}

.auth-security-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--auth-text-muted);
}

.auth-security-strip__icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--auth-success);
}

.auth-security-strip__icon svg {
  width: 100%;
  height: 100%;
}

.auth-footer-link--subtle a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
}

.auth-footer-link--subtle a svg {
  width: 14px;
  height: 14px;
}

/* Entity selection v2 */
.auth-entity-search {
  position: relative;
  margin-bottom: 1rem;
}

.auth-entity-search__icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--auth-text-muted);
  pointer-events: none;
}

.auth-entity-search__icon svg {
  width: 100%;
  height: 100%;
}

.auth-entity-search__input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.65rem;
  border: 1.5px solid var(--auth-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  background: #f8fafc;
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-entity-search__input:focus {
  outline: none;
  border-color: var(--auth-teal);
  box-shadow: 0 0 0 3px var(--auth-teal-glow);
  background: #fff;
}

.auth-company-card--v2 {
  position: relative;
  border-radius: 14px;
  padding: 1.35rem 1rem 1.15rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.auth-company-card--v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 184, 168, 0.15);
}

.auth-company-card--v2.is-selected {
  transform: translateY(-1px);
}

.auth-company-card--v2.is-filtered-out {
  display: none;
}

.auth-company-card__check {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--auth-teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-company-card__check svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
}

.auth-company-card--v2.is-selected .auth-company-card__check {
  opacity: 1;
  transform: scale(1);
}

.auth-card--login-sel .auth-company-card.is-selected::after {
  content: none;
}

.auth-page--portal-client .auth-company-card--v2.is-selected {
  border-color: var(--ql-client-from);
  background: linear-gradient(145deg, #fff7ed 0%, #fff 100%);
}

.auth-page--portal-client .auth-company-card--v2.is-selected .auth-company-card__check {
  background: var(--ql-client-from);
}

.auth-page--portal-provider .auth-company-card--v2.is-selected {
  border-color: #198754;
  background: linear-gradient(145deg, #f0fdf6 0%, #fff 100%);
}

.auth-page--portal-provider .auth-company-card--v2.is-selected .auth-company-card__check {
  background: #198754;
}

.auth-empty-state {
  text-align: center;
  padding: 1rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-card--v2 {
    animation: none;
  }

  .auth-page--exit {
    transition: none;
  }

  .auth-company-card--v2:hover {
    transform: none;
  }
}
