/**
 * Portal auth — carbón + oro (misma línea que axions.es)
 */
.portal-auth-body {
  --auth-ink: #0a0a0b;
  --auth-gold: #c4a962;
  --auth-gold-hover: #d4b978;
  --auth-muted: rgba(255, 255, 255, 0.58);
  --auth-line: rgba(255, 255, 255, 0.12);
  margin: 0;
  min-height: 100dvh;
  font-family: "DM Sans", system-ui, sans-serif;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 55% at 70% 0%, rgba(196, 169, 98, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(196, 169, 98, 0.08), transparent 50%),
    linear-gradient(165deg, #0a0a0b 0%, #121214 50%, #1a1814 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.portal-auth-shell {
  max-width: 440px;
  margin: 0 auto;
  padding: max(2rem, env(safe-area-inset-top)) max(1.15rem, env(safe-area-inset-right)) max(2.5rem, env(safe-area-inset-bottom)) max(1.15rem, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  justify-content: center;
}

.portal-auth-brand {
  display: block;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 0;
}

.portal-auth-brand .axions-brand-logo--auth {
  max-height: 2.5rem;
  width: auto;
  max-width: min(280px, 72vw);
}

.portal-auth-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--auth-line);
  border-radius: 1rem;
  padding: 1.85rem 1.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.portal-auth-card--wide { max-width: 100%; }

.portal-auth-card h1 {
  margin: 0 0 0.55rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}

.portal-auth-lead {
  margin: 0 0 1.35rem;
  color: var(--auth-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.portal-auth-lead strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.portal-auth-lead a {
  color: var(--auth-gold);
  font-weight: 600;
  text-decoration: none;
}

.portal-auth-lead a:hover {
  color: var(--auth-gold-hover);
}

.portal-auth-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.portal-auth-form input[type="email"],
.portal-auth-form input[type="password"],
.portal-auth-form input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--auth-line);
  border-radius: 0.55rem;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color 0.2s ease;
}

.portal-auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.portal-auth-form input:focus {
  border-color: var(--auth-gold);
  outline: none !important;
}

.portal-auth-btn {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.95rem 1rem;
  min-height: 48px;
  border: 1px solid var(--auth-gold);
  border-radius: 999px;
  background: var(--auth-gold);
  color: #0a0a0b;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, transform 0.2s ease;
}

.portal-auth-btn:hover {
  background: var(--auth-gold-hover);
  border-color: var(--auth-gold-hover);
  color: #0a0a0b;
  transform: translateY(-1px);
}

.portal-auth-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.portal-auth-btn--inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  text-decoration: none;
  text-align: center;
}

.portal-auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 0.55rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.portal-auth-alert--error {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.28);
}

.portal-auth-alert--ok {
  background: rgba(52, 211, 153, 0.12);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.portal-auth-links {
  font-size: 0.875rem;
  text-align: center;
  margin-top: 1.35rem;
  line-height: 1.9;
  color: var(--auth-muted);
}

.portal-auth-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
}

.portal-auth-links a:hover {
  color: var(--auth-gold);
}

.portal-auth-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  margin-top: 1.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.portal-auth-foot a {
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.portal-auth-foot a:hover {
  color: var(--auth-gold);
}

.portal-modules-pick {
  border: 1px solid var(--auth-line);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.portal-module-check,
.portal-terms-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-weight: 400;
  margin-bottom: 0.65rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.875rem;
}

.portal-terms-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--auth-gold);
}

.portal-terms-text {
  font-size: 0.9rem;
  color: var(--auth-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Dashboard portal clientes */
.portal-dash-body {
  margin: 0;
  background: var(--bg-beige);
  min-height: 100dvh;
  overflow-x: hidden;
}

.portal-dash-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: max(0.875rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.875rem max(1rem, env(safe-area-inset-left));
  background: #fff;
  border-bottom: 1px solid #e5e2da;
  position: sticky;
  top: 0;
  z-index: 10;
}

.portal-dash-user {
  min-width: 0;
  font-size: 0.85rem;
  overflow: hidden;
}

.portal-dash-user strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-dash-user span {
  display: block;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
}

.portal-dash-logout {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border, #e4e4e7);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.portal-dash-main {
  padding: 1.25rem max(1rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  max-width: 960px;
  margin: 0 auto;
}

.portal-dash-main h1 {
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.portal-dash-sub { color: var(--text-muted); margin-top: 0; font-size: 0.95rem; }

.portal-dash-banner {
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.portal-dash-banner a {
  color: inherit;
  font-weight: 600;
}

.portal-dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.portal-dash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 112px;
  min-width: 0;
  padding: 1rem 0.65rem;
  background: #fff;
  border: 1px solid var(--border, #e4e4e7);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}

.portal-dash-card svg,
.portal-dash-card i {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--axions-gold, #d4af37);
}

.portal-dash-card--locked {
  border-color: rgba(196, 169, 98, 0.45);
  background: rgba(196, 169, 98, 0.06);
  position: relative;
}

.portal-dash-card--locked .portal-dash-card__lock {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 0.875rem;
  height: 0.875rem;
  color: var(--axions-gold, #d4af37);
}

.portal-dash-card small {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
}

.portal-dash-card--contract {
  border-style: dashed;
}

@media (min-width: 640px) {
  .portal-dash-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .portal-dash-card {
    min-height: 120px;
    font-size: 0.9rem;
    padding: 1.25rem 1rem;
  }

  .axions-brand-logo--portal { height: 2.75rem; max-width: min(260px, 62vw); }
}

@media (max-width: 380px) {
  .portal-dash-top {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo logout"
      "user user";
  }

  .axions-brand-logo--portal { grid-area: logo; }
  .portal-dash-user { grid-area: user; }
  .portal-dash-logout { grid-area: logout; }
}

@media (max-width: 480px) {
  .portal-auth-shell { padding-left: 0.85rem; padding-right: 0.85rem; }

  .portal-auth-card {
    padding: 1.45rem 1.1rem;
  }

  .portal-auth-card h1 { font-size: 1.55rem; }

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