/**
 * Portal cliente — mobile-first, glassmorphism, alineado al design system interno.
 */

/* —— CTAs y campos (tema: verde oscuro / naranja claro vía --color-primary) —— */
.portal-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  background: var(--color-primary);
  color: var(--color-cta-text);
  border: 1px solid rgba(var(--color-primary-rgb), 0.45);
  font-weight: 700;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    box-shadow 0.25s ease;
}

.portal-btn-primary:active {
  transform: scale(0.97);
}

.portal-btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 4px 20px rgba(var(--color-primary-rgb), 0.25);
  color: var(--color-cta-text);
}

.portal-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  background: transparent;
  font-weight: 600;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-btn-secondary:active {
  transform: scale(0.97);
}

.portal-btn-secondary:hover {
  color: var(--text-main);
  border-color: rgba(var(--color-primary-rgb), 0.35);
}

.portal-field {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-main);
}

html[data-theme='light'] body.portal-body .portal-field {
  background: rgba(255, 255, 255, 0.85);
}

.portal-field:focus {
  outline: none;
  border-color: rgba(var(--color-primary-rgb), 0.45);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

.portal-choice-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
  padding: 1.25rem 1.5rem;
  border-radius: 1.5rem;
  background: var(--portal-glass-bg);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-choice-card:hover {
  border-color: rgba(var(--color-primary-rgb), 0.4);
  box-shadow: var(--portal-glass-shadow);
}

.portal-choice-card--restricted:hover {
  border-color: rgba(var(--color-warning-rgb), 0.45);
}

.portal-choice-card__icon {
  color: var(--color-primary);
  font-size: 1.875rem;
  margin-bottom: 0.75rem;
}

.portal-choice-card--restricted .portal-choice-card__icon {
  color: var(--color-warning);
}

.portal-restricted-intro {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin: 0 0 0.5rem;
  line-height: 1.45;
}

.portal-restricted-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
  max-height: 9.5rem;
  overflow-y: auto;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.35rem 0.5rem 0;
  scrollbar-width: thin;
}

@media (min-width: 480px) {
  .portal-restricted-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-restricted-item {
  font-size: 0.6875rem;
  line-height: 1.35;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(var(--color-warning-rgb), 0.1);
  border: 1px solid rgba(var(--color-warning-rgb), 0.22);
  color: var(--text-main);
}

html[data-theme='light'] body.portal-body .portal-restricted-item {
  background: rgba(var(--color-warning-rgb), 0.08);
}

.portal-confirm-panel {
  border: 1px solid rgba(var(--color-primary-rgb), 0.22);
}

/* —— Layout: topbar + main —— */
body.portal-body {
  color: var(--text-main);
}

.portal-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding-top: max(env(safe-area-inset-top, 0px), 0.25rem);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.portal-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding-bottom: 0.5rem;
}

.portal-topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  color: var(--text-main);
}

.portal-topbar__label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.portal-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.portal-topbar__btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 0.875rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.portal-topbar__btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(var(--color-primary-rgb), 0.35);
  color: var(--text-main);
}

.portal-topbar__btn--text {
  padding: 0 1rem;
}

main.portal-main-shell {
  position: relative;
  z-index: 1;
  padding-top: calc(3.75rem + max(env(safe-area-inset-top, 0px), 0.25rem));
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2rem);
}

@media (min-width: 640px) {
  main.portal-main-shell {
    padding-top: calc(4rem + max(env(safe-area-inset-top, 0px), 0.25rem));
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* —— Intro / page headers —— */
.portal-page-intro {
  margin-bottom: 2rem;
}

.portal-hero-kicker {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.35rem;
}

.portal-hero-title {
  font-family: Sora, system-ui, sans-serif;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
  margin: 0;
}

@media (min-width: 640px) {
  .portal-hero-title {
    font-size: 1.875rem;
  }
}

.portal-hero-meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.portal-chip-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(var(--color-primary-rgb), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb), 0.22);
  color: var(--color-primary);
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.portal-chip-ghost .material-icons-round {
  font-size: 1rem;
  opacity: 0.85;
}

.portal-hero-sub {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin: 0;
}

.portal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}

.portal-back-link:hover {
  color: var(--color-primary);
}

.portal-back-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

/* —— Surface cards (glass) —— */
.portal-surface-card {
  background: var(--portal-glass-bg);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  border: 1px solid var(--color-glass-border);
  border-radius: 1.5rem;
  box-shadow: var(--portal-glass-shadow);
  transition: box-shadow 0.25s ease, transform 0.2s ease, background 0.25s ease;
}

@media (hover: hover) {
  a.portal-surface-card:hover {
    box-shadow: var(--portal-glass-strong-shadow);
  }
}

.portal-section-title {
  font-family: Sora, system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.portal-muted {
  color: var(--text-dim);
}

.portal-subtle {
  color: var(--text-muted);
}

/* Status pills */
.portal-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 0.875rem;
  border: 1px solid transparent;
}

.portal-status-pill--transit {
  background: rgba(var(--color-warning-rgb), 0.18);
  color: var(--color-warning);
  border-color: rgba(var(--color-warning-rgb), 0.3);
}

.portal-status-pill--docs {
  background: rgba(var(--color-danger-rgb), 0.16);
  color: var(--color-danger);
  border-color: rgba(var(--color-danger-rgb), 0.28);
}

.portal-status-pill--arriving {
  background: rgba(var(--color-success-rgb), 0.18);
  color: var(--color-success);
  border-color: rgba(var(--color-success-rgb), 0.28);
}

.portal-status-pill--done {
  background: rgba(var(--color-primary-rgb), 0.16);
  color: var(--color-primary);
  border-color: rgba(var(--color-primary-rgb), 0.28);
}

.portal-status-pill--canceled {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-dim);
  border-color: rgba(148, 163, 184, 0.25);
}

.portal-status-pill--default {
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--text-main);
  border-color: rgba(var(--color-primary-rgb), 0.2);
}

.portal-status-pill.portal-status-live {
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.25);
}

.portal-icon-sq {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.875rem;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(var(--color-primary-rgb), 0.15);
}

.portal-icon-sq--sky {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}

.portal-icon-sq--teal {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}

.portal-flash-stack .portal-flash-alert {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.portal-flash-stack .btn-close {
  filter: none;
  opacity: 0.5;
}

html[data-theme="light"] .portal-flash-stack .btn-close {
  opacity: 0.45;
}

.portal-inset-panel {
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

html[data-theme="light"] body.portal-body .portal-inset-panel {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(var(--color-primary-rgb), 0.15);
}

.portal-quote-table {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] body.portal-body .portal-quote-table {
  background: rgba(255, 255, 255, 0.65);
}

.portal-doc-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.portal-doc-row:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
  border-color: rgba(var(--color-primary-rgb), 0.2);
}

html[data-theme="light"] body.portal-body .portal-doc-row {
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] body.portal-body .portal-doc-row:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
}

/* Auth pages: theme toggle fixed */
.portal-auth-toggle {
  position: fixed;
  top: max(env(safe-area-inset-top, 0px), 1rem);
  right: 1rem;
  z-index: 20;
}

html[data-theme="light"] .portal-topbar {
  background: rgba(255, 255, 255, 0.72);
  border-bottom-color: rgba(var(--color-primary-rgb), 0.15);
}

html[data-theme="light"] .portal-topbar__btn {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-main);
}

html[data-theme="light"] .portal-topbar__btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(var(--color-primary-rgb), 0.35);
}

:root {
  --portal-safe-b: env(safe-area-inset-bottom, 0px);
  --portal-safe-t: env(safe-area-inset-top, 0px);

  --portal-glass-bg: rgba(255, 255, 255, 0.04);
  --portal-glass-border: transparent;
  --portal-glass-shadow: 0 24px 56px -20px rgba(0, 0, 0, 0.38);

  --portal-glass-strong-bg: rgba(255, 255, 255, 0.055);
  --portal-glass-strong-border: transparent;
  --portal-glass-strong-inset: rgba(255, 255, 255, 0.07);
  --portal-glass-strong-shadow: 0 32px 64px -22px rgba(0, 0, 0, 0.42);

  --portal-map-border: transparent;
  --portal-map-shadow-outer: 0 20px 50px rgba(0, 0, 0, 0.5);
  --portal-map-shadow-inset: inset 0 0 60px rgba(15, 20, 18, 0.35);

  --portal-progress-track-bg: rgba(255, 255, 255, 0.08);
  --portal-quote-row-border: rgba(255, 255, 255, 0.06);

  --portal-header-bg: rgba(8, 12, 10, 0.72);
  --portal-header-border: rgba(255, 255, 255, 0.1);

  --portal-glow-pulse-1: rgba(45, 212, 191, 0.2);
  --portal-glow-pulse-2: rgba(45, 212, 191, 0.12);
}

html[data-theme="light"] {
  --portal-glass-bg: rgba(255, 255, 255, 0.48);
  --portal-glass-border: transparent;
  --portal-glass-shadow: 0 20px 48px -18px rgba(15, 45, 35, 0.08);

  --portal-glass-strong-bg: rgba(255, 255, 255, 0.62);
  --portal-glass-strong-border: transparent;
  --portal-glass-strong-inset: rgba(255, 255, 255, 0.88);
  --portal-glass-strong-shadow: 0 24px 56px -20px rgba(15, 45, 35, 0.1);

  --portal-map-border: transparent;
  --portal-map-shadow-outer: 0 16px 40px rgba(15, 45, 35, 0.12);
  --portal-map-shadow-inset: inset 0 0 48px rgba(255, 255, 255, 0.45);

  --portal-progress-track-bg: rgba(15, 45, 35, 0.1);
  --portal-quote-row-border: rgba(15, 45, 35, 0.08);

  --portal-header-bg: rgba(255, 255, 255, 0.82);
  --portal-header-border: rgba(18, 52, 40, 0.1);

  --portal-glow-pulse-1: rgba(45, 180, 155, 0.35);
  --portal-glow-pulse-2: rgba(45, 180, 155, 0.2);
}

@keyframes portal-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes portal-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.portal-enter {
  animation: portal-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.portal-glass {
  background: var(--portal-glass-bg);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  border: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    var(--portal-glass-shadow);
}

.portal-glass-strong {
  background: var(--portal-glass-strong-bg);
  backdrop-filter: blur(36px) saturate(140%);
  -webkit-backdrop-filter: blur(36px) saturate(140%);
  border: none;
  box-shadow:
    inset 0 1px 0 var(--portal-glass-strong-inset),
    var(--portal-glass-strong-shadow);
}

/* Tarjetas de pedido: hover sin “anillo” de borde */
.portal-order-card:hover {
  background: rgba(255, 255, 255, 0.065);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 36px 72px -24px rgba(0, 0, 0, 0.48);
}

html[data-theme="light"] body.portal-body .portal-order-card:hover {
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 28px 56px -18px rgba(15, 45, 35, 0.12);
}

/* Archivados: bloque principal (más aire, integrado al fondo) */
.portal-archived-trigger {
  border: none;
  background: rgba(255, 255, 255, 0.038);
  backdrop-filter: blur(32px) saturate(130%);
  -webkit-backdrop-filter: blur(32px) saturate(130%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 28px 60px -24px rgba(0, 0, 0, 0.4);
  transition: background 0.28s ease, box-shadow 0.28s ease;
}

@media (hover: hover) {
  .portal-archived-trigger:hover {
    background: rgba(255, 255, 255, 0.048);
  }
}

html[data-theme="light"] body.portal-body .portal-archived-trigger {
  background: rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 22px 50px -20px rgba(15, 45, 35, 0.09);
}

@media (hover: hover) {
  html[data-theme="light"] body.portal-body .portal-archived-trigger:hover {
    background: rgba(255, 255, 255, 0.58);
  }
}

.portal-archived-row {
  transition: background 0.22s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .portal-archived-row.portal-glass:hover {
    background: rgba(255, 255, 255, 0.055);
  }
}

@media (hover: hover) {
  html[data-theme="light"] body.portal-body .portal-archived-row.portal-glass:hover {
    background: rgba(255, 255, 255, 0.58);
  }
}

/* Categorías de interés: panel amplio, chips suaves */
.portal-categories-shell {
  border: none;
  background: rgba(255, 255, 255, 0.036);
  backdrop-filter: blur(32px) saturate(130%);
  -webkit-backdrop-filter: blur(32px) saturate(130%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 32px 70px -28px rgba(0, 0, 0, 0.42);
}

html[data-theme="light"] body.portal-body .portal-categories-shell {
  background: rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 24px 56px -22px rgba(15, 45, 35, 0.09);
}

.portal-interest-tag {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  color: rgba(204, 251, 241, 0.9);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] body.portal-body .portal-interest-tag {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.portal-map-shell {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  border: none;
  box-shadow: var(--portal-map-shadow-outer);
}

.portal-map-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: var(--portal-map-shadow-inset);
  z-index: 500;
}

#portal-map {
  height: min(52vh, 380px);
  width: 100%;
  z-index: 1;
}

@media (min-width: 768px) {
  #portal-map {
    height: 360px;
  }
}

.portal-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--portal-progress-track-bg);
  overflow: hidden;
}

.portal-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(var(--color-primary-rgb), 0.55),
    var(--color-primary),
    rgba(var(--color-primary-rgb), 0.85)
  );
  background-size: 200% 100%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-progress-fill--pulse {
  animation: portal-shimmer 3s ease-in-out infinite;
}

.portal-touch-target {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

body.portal-body button,
body.portal-body a.portal-btn-primary,
body.portal-body a.portal-order-card,
body.portal-auth-page button,
body.portal-auth-page a {
  touch-action: manipulation;
}

/* Leaflet: sin controles de zoom visibles para cliente */
.leaflet-control-zoom {
  display: none !important;
}

.portal-map-boat-marker {
  background: transparent !important;
  border: none !important;
}

.portal-map-boat-svg {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-map-boat-svg svg {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.portal-quote-row {
  border-bottom: 1px solid var(--portal-quote-row-border);
}

.portal-quote-row:last-child {
  border-bottom: none;
}

/* Badges de estado (color semántico + punto, sin ancho forzado en flex) */
.portal-status-badge {
  border-width: 1px;
  border-style: solid;
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.portal-status-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
}

.portal-status-badge--docs {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.28), rgba(239, 68, 68, 0.1));
  border-color: rgba(252, 165, 165, 0.4);
  color: #fecaca;
}

.portal-status-badge--docs .portal-status-badge-dot {
  background: #f87171;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.portal-status-badge--transit {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.12));
  border-color: rgba(252, 211, 77, 0.45);
  color: #fde68a;
}

.portal-status-badge--transit .portal-status-badge-dot {
  background: #fbbf24;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.portal-status-badge--arriving {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0.1));
  border-color: rgba(110, 231, 183, 0.4);
  color: #a7f3d0;
}

.portal-status-badge--arriving .portal-status-badge-dot {
  background: #34d399;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.portal-status-badge--done {
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.26), rgba(45, 212, 191, 0.1));
  border-color: rgba(94, 234, 212, 0.45);
  color: #ccfbf1;
}

.portal-status-badge--done .portal-status-badge-dot {
  background: #2dd4bf;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.portal-status-badge--canceled {
  background: linear-gradient(145deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.08));
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.portal-status-badge--canceled .portal-status-badge-dot {
  background: #94a3b8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.portal-status-badge--default {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.82);
}

.portal-status-badge--default .portal-status-badge-dot {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

@keyframes portal-badge-live-pulse {
  0%,
  100% {
    box-shadow:
      0 2px 12px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 1;
  }
  50% {
    box-shadow:
      0 2px 14px rgba(0, 0, 0, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
    opacity: 0.96;
  }
}

.portal-status-badge.portal-status-live {
  animation: portal-badge-live-pulse 4s ease-in-out infinite;
}

/* Panel descripción: relieve y aire interno */
.portal-description-panel {
  border: none;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.032) 55%,
    rgba(0, 0, 0, 0.06) 100%
  );
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  box-shadow:
    0 20px 48px -16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Texto largo (p. ej. descripción generada desde cotización) */
.portal-description-text {
  white-space: pre-line;
  word-break: break-word;
}

/* Fondo de página */
/* Forzar fondo claro por encima de utilidades Tailwind (.bg-dark-bg) */
html[data-theme="light"] body.portal-body,
html[data-theme="light"] body.portal-body.bg-dark-bg {
  background: linear-gradient(165deg, #f2f7f4 0%, #e8f0ec 45%, #dfeae4 100%) !important;
  color: #122018;
}

html[data-theme="light"] body.portal-body .text-white {
  color: #0f1714 !important;
}

/* Sin color-mix (Safari/iOS antiguos en producción ignoraban la regla y el tema quedaba a medias) */
html[data-theme="light"] body.portal-body .text-white\/85 {
  color: rgba(15, 23, 20, 0.85) !important;
}

html[data-theme="light"] body.portal-body .text-white\/90 {
  color: rgba(15, 23, 20, 0.9) !important;
}

html[data-theme="light"] body.portal-body .text-white\/95 {
  color: rgba(15, 23, 20, 0.95) !important;
}

html[data-theme="light"] body.portal-body .text-white\/80 {
  color: rgba(15, 23, 20, 0.8) !important;
}

html[data-theme="light"] body.portal-body .text-white\/75 {
  color: rgba(15, 23, 20, 0.75) !important;
}

html[data-theme="light"] body.portal-body .text-white\/70 {
  color: rgba(15, 23, 20, 0.7) !important;
}

html[data-theme="light"] body.portal-body .text-white\/25 {
  color: rgba(15, 23, 20, 0.25) !important;
}

html[data-theme="light"] body.portal-body .text-white\/20 {
  color: rgba(15, 23, 20, 0.2) !important;
}

html[data-theme="light"] body.portal-body .text-accent-teal,
html[data-theme="light"] body.portal-body .text-teal-200,
html[data-theme="light"] body.portal-body .text-teal-300 {
  color: #0f766e !important;
}

html[data-theme="light"] body.portal-body .text-dim {
  color: #4d6056 !important;
}

html[data-theme="light"] body.portal-body .border-white\/10,
html[data-theme="light"] body.portal-body .border-white\/12,
html[data-theme="light"] body.portal-body .border-white\/15,
html[data-theme="light"] body.portal-body .border-white\/20,
html[data-theme="light"] body.portal-body .border-white\/25,
html[data-theme="light"] body.portal-body .border-white\/30 {
  border-color: rgba(18, 48, 38, 0.12) !important;
}

html[data-theme="light"] body.portal-body .ring-white\/10,
html[data-theme="light"] body.portal-body .ring-white\/5 {
  --tw-ring-color: rgba(18, 48, 38, 0.12) !important;
}

html[data-theme="light"] body.portal-body .bg-white\/5,
html[data-theme="light"] body.portal-body .bg-white\/10 {
  background-color: rgba(255, 255, 255, 0.65) !important;
}

html[data-theme="light"] body.portal-body .bg-white\/\[0\.03\] {
  background-color: rgba(255, 255, 255, 0.55) !important;
}

html[data-theme="light"] body.portal-body .bg-white\/\[0\.06\] {
  background-color: rgba(255, 255, 255, 0.72) !important;
}

html[data-theme="light"] body.portal-body .bg-black\/20 {
  background-color: rgba(255, 255, 255, 0.45) !important;
}

html[data-theme="light"] body.portal-body .divide-white\/\[0\.06\] > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(18, 48, 38, 0.08) !important;
}

html[data-theme="light"] body.portal-body header.sticky {
  background: var(--portal-header-bg) !important;
  border-color: var(--portal-header-border) !important;
}

html[data-theme="light"] body.portal-body .grain-overlay {
  opacity: 0.025 !important;
}

html[data-theme="light"] body.portal-body .portal-theme-toggle {
  color: #1a2e24 !important;
  border-color: rgba(18, 48, 38, 0.15) !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

html[data-theme="light"] body.portal-body .portal-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(45, 180, 155, 0.35) !important;
}

/* Alertas del portal en tema claro */
html[data-theme="light"] body.portal-body .border-red-400\/30 {
  border-color: rgba(220, 80, 70, 0.35) !important;
}

html[data-theme="light"] body.portal-body .text-red-200 {
  color: #7f1d1d !important;
}

html[data-theme="light"] body.portal-body .border-emerald-400\/30 {
  border-color: rgba(16, 120, 80, 0.35) !important;
}

html[data-theme="light"] body.portal-body .text-emerald-100 {
  color: #064e3b !important;
}

html[data-theme="light"] body.portal-body .border-amber-400\/30 {
  border-color: rgba(180, 120, 30, 0.4) !important;
}

html[data-theme="light"] body.portal-body .text-amber-100 {
  color: #713f12 !important;
}

html[data-theme="light"] body.portal-body .text-white\/90.border-white\/15 {
  color: #142018 !important;
}

html[data-theme="light"] body.portal-body .btn-close.btn-close-white {
  filter: invert(0.85);
  opacity: 0.5;
}

/* Badges portal en tema claro */
html[data-theme="light"] body.portal-body .portal-status-badge--docs {
  color: #7f1d1d !important;
  border-color: rgba(185, 28, 28, 0.35) !important;
  background: linear-gradient(145deg, rgba(254, 202, 202, 0.95), rgba(254, 226, 226, 0.75)) !important;
}

html[data-theme="light"] body.portal-body .portal-status-badge--transit {
  color: #78350f !important;
  border-color: rgba(180, 83, 9, 0.4) !important;
  background: linear-gradient(145deg, rgba(253, 230, 138, 0.95), rgba(254, 243, 199, 0.8)) !important;
}

html[data-theme="light"] body.portal-body .portal-status-badge--arriving {
  color: #064e3b !important;
  border-color: rgba(5, 150, 105, 0.4) !important;
  background: linear-gradient(145deg, rgba(167, 243, 208, 0.9), rgba(209, 250, 229, 0.85)) !important;
}

html[data-theme="light"] body.portal-body .portal-status-badge--done {
  color: #115e59 !important;
  border-color: rgba(13, 148, 136, 0.4) !important;
  background: linear-gradient(145deg, rgba(204, 251, 241, 0.95), rgba(236, 253, 245, 0.85)) !important;
}

html[data-theme="light"] body.portal-body .portal-status-badge--canceled {
  color: #475569 !important;
  border-color: rgba(100, 116, 139, 0.35) !important;
  background: linear-gradient(145deg, rgba(241, 245, 249, 0.95), rgba(248, 250, 252, 0.9)) !important;
}

html[data-theme="light"] body.portal-body .portal-status-badge--default {
  color: #1e293b !important;
  border-color: rgba(30, 41, 59, 0.2) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.85)) !important;
}

html[data-theme="light"] body.portal-body .portal-description-panel {
  border: none !important;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 250, 249, 0.78) 100%
  ) !important;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  box-shadow:
    0 10px 36px rgba(15, 45, 35, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

/* Badges de estado en tarjetas (contraste en tema claro) */
html[data-theme="light"] body.portal-body .text-red-300 {
  color: #991b1b !important;
}

html[data-theme="light"] body.portal-body .text-amber-200 {
  color: #92400e !important;
}

html[data-theme="light"] body.portal-body .text-emerald-200 {
  color: #065f46 !important;
}

html[data-theme="light"] body.portal-body .border-red-400\/25 {
  border-color: rgba(185, 28, 28, 0.35) !important;
}

html[data-theme="light"] body.portal-body .border-amber-400\/25 {
  border-color: rgba(180, 83, 9, 0.35) !important;
}

html[data-theme="light"] body.portal-body .border-emerald-400\/30 {
  border-color: rgba(5, 150, 105, 0.35) !important;
}

/* Login portal (misma hoja) */
html[data-theme="light"] body.portal-login-page,
html[data-theme="light"] body.portal-auth-page {
  background: linear-gradient(165deg, #f2f7f4 0%, #e8f0ec 100%) !important;
}

html[data-theme="light"] body.portal-login-page .text-white {
  color: #0f1714 !important;
}

html[data-theme="light"] body.portal-login-page .text-dim {
  color: #4d6056 !important;
}

html[data-theme="light"] body.portal-login-page .glass-panel {
  background: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(18, 48, 38, 0.12) !important;
  box-shadow: 0 12px 40px rgba(15, 45, 35, 0.08) !important;
}

/*
 * Login / registro portal: texto siempre legible (focus, :focus-visible, autofill WebKit).
 * register.html no incluye Tailwind; form-control-premium no define color de fondo en este proyecto.
 */
body.portal-login-page .form-control,
body.portal-login-page .form-select,
body.portal-login-page textarea.form-control {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
}

body.portal-login-page .form-control:focus,
body.portal-login-page .form-control:focus-visible,
body.portal-login-page .form-select:focus,
body.portal-login-page .form-select:focus-visible,
body.portal-login-page textarea.form-control:focus,
body.portal-login-page textarea.form-control:focus-visible {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(13, 148, 136, 0.65) !important;
  box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.28) !important;
}

body.portal-login-page .form-control::placeholder,
body.portal-login-page textarea.form-control::placeholder {
  color: #64748b !important;
  opacity: 1;
}

body.portal-login-page input:-webkit-autofill,
body.portal-login-page input:-webkit-autofill:hover,
body.portal-login-page input:-webkit-autofill:focus,
body.portal-login-page textarea:-webkit-autofill,
body.portal-login-page textarea:-webkit-autofill:hover,
body.portal-login-page textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 99999s ease-out;
}

html[data-theme="light"] body.portal-login-page .form-control,
html[data-theme="light"] body.portal-login-page .form-select,
html[data-theme="light"] body.portal-login-page textarea.form-control,
html[data-theme="light"] body.portal-login-page .form-control:focus,
html[data-theme="light"] body.portal-login-page .form-control:focus-visible,
html[data-theme="light"] body.portal-login-page textarea.form-control:focus,
html[data-theme="light"] body.portal-login-page textarea.form-control:focus-visible {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] body.portal-login-page input:-webkit-autofill,
html[data-theme="light"] body.portal-login-page input:-webkit-autofill:hover,
html[data-theme="light"] body.portal-login-page input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}

/* Enlace “Ya tengo cuenta” / botones glass sin Tailwind */
body.portal-login-page a.btn.btn-glass,
body.portal-login-page .btn.btn-glass {
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

body.portal-login-page a.btn.btn-glass:hover,
body.portal-login-page .btn.btn-glass:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(45, 212, 191, 0.45) !important;
}

html[data-theme="light"] body.portal-login-page a.btn.btn-glass,
html[data-theme="light"] body.portal-login-page .btn.btn-glass {
  color: #0f172a !important;
  border-color: rgba(18, 48, 38, 0.2) !important;
  background: rgba(255, 255, 255, 0.75) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Premium mobile-first: auth, micro-animaciones, touch targets
   ═══════════════════════════════════════════════════════════════════════════ */

html {
  -webkit-tap-highlight-color: transparent;
}

body.portal-body,
body.portal-auth-page,
body.portal-login-page {
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

/* Auth shell (hub, login, register, staff) */
body.portal-auth-page {
  min-height: 100dvh;
  min-height: 100vh;
  padding: max(env(safe-area-inset-top, 0px), 0.75rem) max(env(safe-area-inset-right, 0px), 1rem)
    max(env(safe-area-inset-bottom, 0px), 1.25rem) max(env(safe-area-inset-left, 0px), 1rem);
}

.portal-auth-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  /* Nunca es una tarjeta: solo ancho/centrado (evita caja-dentro-de-caja) */
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.portal-auth-shell--wide {
  max-width: 48rem;
}

.portal-auth-shell--hub {
  max-width: 64rem;
}

.portal-auth-brand {
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .portal-auth-brand {
    margin-bottom: 1.75rem;
  }
}

/* Hub: tarjetas apiladas en móvil con entrada escalonada */
.auth-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .auth-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
  }
}

.auth-hub-card {
  border-radius: 2rem;
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.25s ease;
  animation: portal-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-hub-card:nth-child(1) {
  animation-delay: 0.08s;
}

.auth-hub-card:nth-child(2) {
  animation-delay: 0.16s;
}

@media (hover: hover) {
  .auth-hub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 56px -20px rgba(0, 0, 0, 0.45);
  }
}

.auth-hub-card:active {
  transform: scale(0.985);
}

/* Botones premium (pill + feedback táctil) */
.portal-btn-premium,
body.portal-auth-page .btn.btn-teal-solid,
body.portal-login-page .btn.btn-teal-solid {
  position: relative;
  overflow: hidden;
  min-height: 48px;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    opacity 0.2s ease;
}

.portal-btn-premium::after,
body.portal-auth-page .btn.btn-teal-solid::after,
body.portal-login-page .btn.btn-teal-solid::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .portal-btn-premium:hover::after,
  body.portal-auth-page .btn.btn-teal-solid:hover::after,
  body.portal-login-page .btn.btn-teal-solid:hover::after {
    transform: translateX(120%);
  }
}

.portal-btn-premium:active,
body.portal-auth-page .btn.btn-teal-solid:active,
body.portal-login-page .btn.btn-teal-solid:active {
  transform: scale(0.97);
}

.portal-btn-ghost-premium {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(var(--color-primary-rgb), 0.35);
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--text-main);
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.2s ease,
    border-color 0.2s ease;
}

.portal-btn-ghost-premium:active {
  transform: scale(0.97);
}

.portal-btn-staff-premium {
  min-height: 48px;
  border-radius: 9999px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.portal-btn-staff-premium:active {
  transform: scale(0.97);
}

/* Inputs auth: píldora + glow al focus */
body.portal-auth-page .input-glass,
body.portal-login-page .input-glass {
  min-height: 48px;
  font-size: 1rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    background 0.2s ease;
}

body.portal-auth-page .input-glass:focus,
body.portal-login-page .input-glass:focus {
  box-shadow:
    0 0 0 2px rgba(var(--color-primary-rgb), 0.35),
    0 8px 24px -8px rgba(var(--color-primary-rgb), 0.35);
}

/* Indicador de pasos (solo envío) */
.portal-step-indicator {
  margin-bottom: 1.5rem;
}

.portal-step-indicator__track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.portal-step-indicator__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(var(--color-primary-rgb), 0.65),
    var(--color-primary)
  );
  box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.4);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-step-indicator__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.portal-step-indicator__step {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.portal-step-indicator__name {
  color: var(--text-dim);
  font-weight: 500;
}

/* Acciones de formulario: sticky en móvil */
.portal-form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

@media (max-width: 639px) {
  .portal-form-actions--sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding: 1rem 0.25rem calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(8, 12, 10, 0.88) 28%,
      rgba(8, 12, 10, 0.96) 100%
    );
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  html[data-theme="light"] body.portal-body .portal-form-actions--sticky {
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(242, 247, 244, 0.92) 28%,
      rgba(242, 247, 244, 0.98) 100%
    );
  }
}

/* Tarjetas de pedido: layout móvil sin solapamiento del chevron */
.portal-order-card--interactive {
  position: relative;
  padding-right: 3rem;
}

@media (min-width: 640px) {
  .portal-order-card--interactive {
    padding-right: 1.75rem;
  }
}

.portal-order-card__chevron {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148, 163, 184, 0.45);
  transition: color 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.portal-order-card--interactive:hover .portal-order-card__chevron,
.portal-order-card--interactive:focus-visible .portal-order-card__chevron {
  color: var(--color-primary);
  transform: translate(2px, -50%);
}

/* Choice cards: altura mínima táctil */
.portal-choice-card {
  min-height: 11rem;
  transform: translateZ(0);
  transition:
    border-color 0.25s ease,
    box-shadow 0.3s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-choice-card:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .portal-choice-card:hover {
    transform: translateY(-2px);
  }

  .portal-choice-card:active {
    transform: scale(0.98) translateY(0);
  }
}

/* Hover lift refinado en portal */
body.portal-body .hover-lift {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}

@media (hover: hover) {
  body.portal-body a.hover-lift:hover {
    transform: translateY(-2px);
  }
}

body.portal-body a.hover-lift:active {
  transform: scale(0.99);
}

/* Mapa: más alto en móvil landscape / pantallas pequeñas */
@media (max-width: 639px) {
  /* Evita zoom automático en iOS al enfocar inputs */
  body.portal-body input,
  body.portal-body select,
  body.portal-body textarea,
  body.portal-auth-page input,
  body.portal-login-page input {
    font-size: 16px !important;
  }

  #portal-map {
    height: min(45vh, 320px);
    min-height: 220px;
  }

  main.portal-main-shell {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .portal-hero-meta .truncate {
    max-width: 100%;
  }

  .portal-register-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .portal-register-header .btn {
    width: 100%;
    min-height: 48px;
  }
}

/* Cotización móvil: filas apiladas con más aire */
@media (max-width: 639px) {
  .portal-quote-row {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .portal-quote-row .flex.justify-between {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* Pulse suave en CTA principal del dashboard */
@keyframes portal-cta-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.12);
  }
}

.portal-cta-ship {
  animation: portal-cta-glow 3.5s ease-in-out infinite;
}

/* Glass panel auth: borde luminoso */
body.portal-auth-page .glass-panel,
body.portal-login-page .glass-panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 60px -24px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.35s ease;
}

/* Accesibilidad: reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  .portal-enter,
  .auth-hub-card,
  .portal-cta-ship,
  .portal-progress-fill--pulse,
  .portal-status-badge.portal-status-live {
    animation: none !important;
  }

  .portal-btn-premium::after,
  body.portal-auth-page .btn.btn-teal-solid::after {
    display: none;
  }

  .hover-lift,
  .portal-choice-card,
  .portal-order-card--interactive .portal-order-card__chevron {
    transition: none;
  }
}

/* ============================================================
   PORTAL DARK SOLID — alineado con style.css (sin glassmorphism)
   ============================================================ */
html:not([data-theme='light']) {
  --portal-glass-bg: var(--surface-solid-1);
  --portal-glass-border: var(--border-surface);
  --portal-glass-shadow: var(--shadow-surface-sm);
  --portal-glass-strong-bg: var(--surface-solid-2);
  --portal-glass-strong-border: var(--border-surface);
  --portal-glass-strong-inset: rgba(255, 255, 255, 0.08);
  --portal-glass-strong-shadow: var(--shadow-surface-md);
  --portal-header-bg: var(--surface-solid-0);
  --portal-header-border: var(--border-surface);
  --portal-progress-track-bg: var(--surface-solid-0);
  --portal-quote-row-border: var(--border-surface);
}

html:not([data-theme='light']) .ambient-canvas {
  display: none !important;
}

html:not([data-theme='light']) .portal-glass,
html:not([data-theme='light']) .portal-glass-strong,
html:not([data-theme='light']) .portal-card,
html:not([data-theme='light']) .portal-surface-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--portal-glass-bg) !important;
  border-color: var(--portal-glass-border) !important;
  box-shadow: var(--portal-glass-shadow) !important;
}

html:not([data-theme='light']) .portal-glass-strong,
html:not([data-theme='light']) .portal-surface-card--elevated {
  background: var(--portal-glass-strong-bg) !important;
  box-shadow: var(--portal-glass-strong-shadow) !important;
}

html:not([data-theme='light']) .portal-field {
  background: var(--surface-solid-1) !important;
  border-color: var(--border-surface) !important;
}

html:not([data-theme='light']) .portal-choice-card {
  background: var(--surface-solid-1) !important;
  border-color: var(--border-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html:not([data-theme='light']) .portal-choice-card:hover {
  background: var(--surface-solid-2) !important;
  border-color: rgba(var(--color-primary-rgb), 0.35) !important;
}

html:not([data-theme='light']) .portal-topbar {
  background: var(--portal-header-bg) !important;
  border-color: var(--portal-header-border) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Shell = layout puro. Nunca tarjeta (dark ni light). */
.portal-auth-shell,
.portal-auth-shell--hub,
.portal-auth-shell--wide,
html:not([data-theme='light']) .portal-auth-shell,
html:not([data-theme='light']) body.portal-auth-page .portal-auth-shell,
html:not([data-theme='light']) body.portal-login-page .portal-auth-shell,
html[data-theme='light'] .portal-auth-shell {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Solo la tarjeta del formulario / cards del hub */
html:not([data-theme='light']) .portal-auth-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--surface-solid-2) !important;
  border: 1px solid var(--border-surface) !important;
  box-shadow: var(--shadow-surface-lg) !important;
}

html:not([data-theme='light']) .auth-hub-card {
  background: var(--surface-solid-1) !important;
  border: 1px solid var(--border-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: var(--shadow-surface-md) !important;
}

html:not([data-theme='light']) [class*='backdrop-blur'] {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html:not([data-theme='light']) .bg-white\/5,
html:not([data-theme='light']) .bg-white\/10 {
  background-color: var(--surface-solid-1) !important;
}
