/* ==========================================================================
   Servicarga · Autenticación (plataforma)
   Inspirado en el sistema de diseño de MoveOne, adaptado a la identidad
   cálida de Servicarga (#275BF5 → #1a8cff).
   ========================================================================== */

:root {
  --brand-50: #eef3ff;
  --brand-100: #e0e9ff;
  --brand-200: #c7d7ff;
  --brand-300: #9db8ff;
  --brand-500: #275BF5;
  --brand-600: #1d4ed8;
  --brand-700: #1e40af;
  --gold: #1a8cff;

  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;

  --line: #e6ebf2;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --page: #f6f8fc;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-soft: 0 24px 70px -28px rgba(15, 23, 42, .28);
  --shadow-brand: 0 18px 34px -18px rgba(39, 91, 245, .7);

  --font-display: 'Poppins', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-700);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--brand-600); }
a:hover { color: var(--brand-700); }

:focus-visible {
  outline: 3px solid rgba(39, 91, 245, .35);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Estructura general
   -------------------------------------------------------------------------- */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   Panel de marca (izquierda)
   -------------------------------------------------------------------------- */

.auth-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(28px, 4.6vw, 64px);
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(900px 620px at 8% 4%, rgba(39, 91, 245, .55), transparent 62%),
    radial-gradient(760px 560px at 96% 94%, rgba(26, 140, 255, .38), transparent 60%),
    linear-gradient(145deg, #07061f 0%, #120c3a 46%, #1b116e 100%);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), transparent 76%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), transparent 76%);
  pointer-events: none;
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -220px;
  top: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 140, 255, .18), transparent 66%);
  pointer-events: none;
  z-index: -1;
}

.brand-art {
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: min(78%, 720px);
  height: auto;
  opacity: .6;
  pointer-events: none;
  z-index: 0;
}

.brand-top,
.brand-main,
.brand-foot {
  position: relative;
  z-index: 2;
}

.brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Placa blanca para el logo (el archivo viene con fondo blanco) */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 38px -18px rgba(0, 0, 0, .65);
}

.brand-logo img {
  display: block;
  width: 150px;
  height: auto;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .055);
  color: #dbeafe;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.brand-pill svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.brand-main { max-width: 590px; }

.brand-eyebrow {
  margin: 0 0 16px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-300);
}

.brand-title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 3.9vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -.045em;
  color: #ffffff;
}

.brand-title span {
  background: linear-gradient(92deg, #dbeafe 0%, #9db8ff 42%, #1a8cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-copy {
  margin: 0 0 32px;
  max-width: 510px;
  font-size: .98rem;
  line-height: 1.72;
  color: #c7d2fe;
}

.brand-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .075);
  background: rgba(255, 255, 255, .04);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.feature-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(39, 91, 245, .24);
  border: 1px solid rgba(147, 197, 253, .2);
  color: #c7d7ff;
}

.feature-icon svg { width: 19px; height: 19px; }

.feature-text strong {
  display: block;
  font-size: .89rem;
  font-weight: 600;
  color: #eef2ff;
  letter-spacing: -.01em;
}

.feature-text small {
  display: block;
  margin-top: 3px;
  font-size: .77rem;
  line-height: 1.5;
  color: #a5b4fc;
}

.brand-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .73rem;
  color: #a5b4fc;
}

.foot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #4338ca;
}

/* --------------------------------------------------------------------------
   Panel del formulario (derecha)
   -------------------------------------------------------------------------- */

.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 64px);
  background: var(--surface);
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(620px 420px at 100% 0%, rgba(39, 91, 245, .07), transparent 62%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 422px;
  animation: rise .62s cubic-bezier(.2, .7, .2, 1) both;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 30px;
}

.auth-mobile-brand img {
  width: 176px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

.auth-head { margin-bottom: 26px; }

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.auth-badge svg { width: 14px; height: 14px; }

.auth-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.9vw, 2.25rem);
  line-height: 1.14;
  letter-spacing: -.035em;
  color: var(--ink-900);
}

.auth-sub {
  margin: 0;
  font-size: .92rem;
  line-height: 1.66;
  color: var(--ink-500);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.field label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-700);
  letter-spacing: .01em;
}

.label-row a {
  font-size: .77rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-600);
  white-space: nowrap;
}

.label-row a:hover { text-decoration: underline; }

.control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.control:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(39, 91, 245, .14);
}

.control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}

.control > svg {
  flex: none;
  width: 19px;
  height: 19px;
  color: var(--ink-400);
  transition: color .2s ease;
}

.control:focus-within > svg { color: var(--brand-500); }

.control input {
  width: 100%;
  height: 50px;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: .94rem;
  color: var(--ink-900);
  letter-spacing: .01em;
}

.control input::placeholder { color: #a3aec2; }
.control input:focus-visible { outline: none; }

.control input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px #ffffff inset;
  -webkit-text-fill-color: var(--ink-900);
}

.reveal {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-400);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.reveal:hover {
  background: var(--brand-50);
  color: var(--brand-600);
}

.reveal svg { width: 19px; height: 19px; }

.reveal .icon-off { display: none; }

.reveal[aria-pressed="true"] .icon-on { display: none; }
.reveal[aria-pressed="true"] .icon-off { display: block; }

.btn-primary {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary svg { width: 18px; height: 18px; }

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 22px 40px -18px rgba(39, 91, 245, .8);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  cursor: progress;
  filter: saturate(.92);
}

.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn-primary.is-loading .spinner { display: block; }
.btn-primary.is-loading .label,
.btn-primary.is-loading .arrow { display: none; }

.btn-outline {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink-700);
  font-family: inherit;
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.btn-outline:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  color: var(--brand-700);
}

.btn-outline svg { width: 18px; height: 18px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--ink-400);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

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

.auth-help {
  margin: 18px 0 0;
  text-align: center;
  font-size: .79rem;
  line-height: 1.6;
  color: var(--ink-500);
}

.auth-help a {
  font-weight: 600;
  text-decoration: none;
}

.auth-help a:hover { text-decoration: underline; }

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-400);
  font-size: .71rem;
  letter-spacing: .01em;
}

.secure-note svg { width: 15px; height: 15px; }

.auth-foot {
  display: none;
  margin-top: 26px;
  text-align: center;
  font-size: .69rem;
  line-height: 1.7;
  color: var(--ink-400);
}

/* --------------------------------------------------------------------------
   Alerta en línea
   -------------------------------------------------------------------------- */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.55;
  animation: rise .25s ease both;
}

.auth-alert svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

/* --------------------------------------------------------------------------
   Modal de recuperación
   -------------------------------------------------------------------------- */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.auth-modal.is-open { display: flex; }

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  padding: 28px 26px 24px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 30px 60px -16px rgba(15, 23, 42, .5);
  animation: rise .22s ease both;
}

.auth-modal-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: -.02em;
  color: var(--ink-900);
}

.auth-modal-card p {
  margin: 0 0 18px;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink-500);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--page);
  color: var(--ink-500);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.auth-modal-close:hover {
  background: var(--brand-50);
  color: var(--brand-600);
}

.auth-modal-card .control { margin-bottom: 16px; }

.auth-modal-card .btn-primary { margin-top: 0; }

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

/* --------------------------------------------------------------------------
   Animaciones
   -------------------------------------------------------------------------- */

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

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

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr; }

  .auth-brand { display: none; }

  .auth-panel {
    align-items: center;
    padding: 32px 20px;
    background:
      radial-gradient(760px 520px at 100% 0%, rgba(39, 91, 245, .12), transparent 58%),
      radial-gradient(680px 460px at 0% 100%, rgba(26, 140, 255, .1), transparent 58%),
      var(--page);
  }

  .auth-card {
    max-width: 448px;
    margin: 0 auto;
    padding: 30px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .auth-mobile-brand { display: flex; }
  .auth-foot { display: block; }
}

@media (max-width: 540px) {
  .auth-panel { padding: 14px; }

  .auth-card {
    padding: 24px 19px;
    border-radius: 18px;
  }

  .auth-mobile-brand { margin-bottom: 26px; }
  .auth-mobile-brand img { width: 158px; }

  .auth-title { font-size: 1.62rem; }
  .auth-sub { font-size: .88rem; }

  .control { min-height: 50px; }
  .control input { height: 48px; }
  .btn-primary { min-height: 50px; }

  .label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

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

  .btn-primary,
  .btn-primary .arrow {
    transition: none;
  }
}

/* Logos del portal 4-72 */
.brand-logos { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-logos .brand-logo { padding: 10px 14px; border-radius: 14px; }
.brand-logo--472 img { width: 74px; height: auto; }
.brand-logo--sv img { width: 132px; height: auto; }
@media (max-width: 540px) { .brand-logo--472 img { width: 62px; } .brand-logo--sv img { width: 110px; } }


/* Ajuste de los logos en móvil */
.auth-mobile-brand { gap: 10px; flex-wrap: wrap; }
.auth-mobile-brand img { width: auto !important; height: 46px !important; object-fit: contain; }
.auth-mobile-brand img:first-child { height: 52px !important; }

