/* ================================================================
   Soft Retail — Auth (login) styles
   Inspired by https://soft-ia.cloud/retail/ — navy + cyan accent.
   Glass-morphism + animated background, fast & robust.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta portada de la Intranet SoftIA (Frontend/tailwind.config.ts + index.css):
     navy profundo brand-900 #000d1a -> brand-400 #1a8cff, tema oscuro glass. */
  --auth-brand: #1a8cff;            /* brand-400 */
  --auth-brand-light: #4da6ff;      /* brand-300 */
  --auth-brand-dark: #00284d;       /* brand-800 */
  --auth-accent: #4da6ff;           /* brand-300 */
  --auth-accent-soft: #80c0ff;      /* brand-200 */
  --auth-accent-light: #b3daff;     /* brand-100 */
  --auth-cream: #000d1a;            /* brand-900, fondo base oscuro */
  --auth-text: #ffffff;
  --auth-text-soft: rgba(255, 255, 255, 0.65);
  --auth-glass-bg: rgba(255, 255, 255, 0.05);
  --auth-glass-border: rgba(255, 255, 255, 0.12);
  --auth-glass-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55),
                       0 8px 32px -8px rgba(26, 140, 255, 0.35);
  --auth-input-bg: rgba(255, 255, 255, 0.05);
  --auth-input-border: rgba(255, 255, 255, 0.14);
  --auth-input-focus: rgba(77, 166, 255, 0.7);
  --auth-danger: #f87171;
}

/* Hide global header/footer only on the login page */
body.auth-body .topbar,
body.auth-body .site-topbar,
body.auth-body .foot,
body.auth-body .site-foot { display: none !important; }
body.auth-body { background: var(--auth-cream); margin: 0; overflow: hidden; }
body.auth-body main { max-width: none; padding: 0; margin: 0; }

.auth-page {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--auth-text);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* ================================================================
   BACKGROUND — discreet, with life: 3 blobs + grid + few particles
   ================================================================ */
.auth-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 70% at 0% 0%, rgba(26, 140, 255, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(0, 119, 230, 0.35) 0%, transparent 55%),
    linear-gradient(135deg, #001428 0%, #000d1a 100%);
  overflow: hidden;
}

/* Subtle grid pattern */
.auth-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 80%);
  pointer-events: none;
}

/* Blobs */
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
  pointer-events: none;
}
.auth-blob.b1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, var(--auth-brand-light), transparent 70%);
  top: -160px; left: -120px;
  opacity: 0.45;
  animation: drift-1 28s ease-in-out infinite;
}
.auth-blob.b2 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--auth-accent-light), transparent 70%);
  bottom: -140px; right: -100px;
  opacity: 0.4;
  animation: drift-2 32s ease-in-out infinite;
}
.auth-blob.b3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #59a0ff, transparent 70%);
  top: 35%; left: 32%;
  opacity: 0.25;
  animation: drift-3 36s ease-in-out infinite;
}
@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(50px, 60px) scale(1.06); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-60px, -40px) scale(1.08); }
}
@keyframes drift-3 {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(30px, -25px); }
}

/* Floating particles - just 6, very subtle */
.auth-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.auth-particles span {
  position: absolute;
  display: block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--auth-brand);
  opacity: 0;
  animation: rise 22s linear infinite;
}
.auth-particles span:nth-child(1) { left: 12%; animation-delay: 0s;  width: 5px; height: 5px; }
.auth-particles span:nth-child(2) { left: 28%; animation-delay: 5s;  background: var(--auth-accent); }
.auth-particles span:nth-child(3) { left: 45%; animation-delay: 9s;  width: 6px; height: 6px; background: var(--auth-brand-light); }
.auth-particles span:nth-child(4) { left: 62%; animation-delay: 3s; }
.auth-particles span:nth-child(5) { left: 78%; animation-delay: 14s; background: var(--auth-accent-light); }
.auth-particles span:nth-child(6) { left: 90%; animation-delay: 7s; width: 5px; height: 5px; }
@keyframes rise {
  0%   { transform: translateY(110vh) translateX(0); opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) translateX(20px); opacity: 0; }
}

/* ================================================================
   LAYOUT
   ================================================================ */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 32px 24px;
}
@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: 1.05fr 1fr;
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 56px;
    gap: 64px;
  }
}

/* ================================================================
   HERO (left, desktop only) — single-pass entry, fast
   ================================================================ */
.auth-hero { display: none; }
@media (min-width: 1024px) {
  .auth-hero {
    display: block;
    opacity: 0;
    transform: translateX(-20px);
    animation: hero-in 0.55s 0.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
}
.auth-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 20px;
  color: var(--auth-text);
}
.auth-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #ffffff 0%, var(--auth-accent-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-hero p {
  font-size: 1.05rem;
  color: var(--auth-text-soft);
  max-width: 460px;
  line-height: 1.65;
  margin: 0;
}
@keyframes hero-in {
  to { opacity: 1; transform: translateX(0); }
}

/* ================================================================
   GLASS CARD
   ================================================================ */
.auth-card-wrap { display: flex; justify-content: center; width: 100%; }
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--auth-glass-bg);
  border: 1px solid var(--auth-glass-border);
  border-radius: 24px;
  padding: 44px 40px;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--auth-glass-shadow);
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  animation: card-in 0.45s 0.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0.04) 40%, rgba(77,166,255,0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Logo + brand */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  opacity: 0;
  animation: rise-in 0.4s 0.2s ease-out forwards;
}
.auth-logo-mark {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.auth-logo-text { display: flex; flex-direction: column; line-height: 1; }
.auth-logo-text .name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
}
.auth-logo-text .name .brand-amo     { color: var(--auth-text); }
.auth-logo-text .name .brand-blarthe { color: var(--auth-brand-light); }
.auth-logo-text .name .brand-soft    { color: var(--auth-text); font-weight: 800; letter-spacing: -0.01em; }
.auth-logo-text .name .brand-ai      {
  color: var(--auth-accent);
  font-weight: 800;
  background: linear-gradient(135deg, #00d4ff 0%, #59a0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 0 1px;
}
.auth-logo-text .tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--auth-text-soft);
  font-weight: 500;
  margin-top: 4px;
}

.auth-card h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  opacity: 0;
  animation: rise-in 0.4s 0.26s ease-out forwards;
}
.auth-sub {
  color: var(--auth-text-soft);
  margin: 0 0 32px;
  font-size: 0.92rem;
  opacity: 0;
  animation: rise-in 0.4s 0.3s ease-out forwards;
}

/* ================================================================
   FORM
   ================================================================ */
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-field {
  position: relative;
  opacity: 0;
  animation: rise-in 0.4s ease-out forwards;
}
.auth-field:nth-of-type(1) { animation-delay: 0.34s; }
.auth-field:nth-of-type(2) { animation-delay: 0.4s; }
.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon {
  position: absolute;
  left: 16px;
  width: 18px; height: 18px;
  color: var(--auth-text-soft);
  pointer-events: none;
  transition: color 0.2s;
}
.auth-input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  background: var(--auth-input-bg);
  border: 1.5px solid var(--auth-input-border);
  border-radius: 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--auth-text);
  outline: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.auth-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.auth-input:hover { border-color: rgba(0, 212, 255, 0.35); }
.auth-input:focus {
  border-color: var(--auth-input-focus);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.16);
}
.auth-input-wrap:focus-within .auth-input-icon { color: var(--auth-brand); }

/* Password toggle */
.auth-toggle-pw {
  position: absolute;
  right: 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  color: var(--auth-text-soft);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
}
.auth-toggle-pw:hover { color: var(--auth-brand); background: rgba(0,212,255,0.10); }
.auth-toggle-pw svg { width: 18px; height: 18px; }
.auth-toggle-pw .eye-off { display: none; }
.auth-toggle-pw[data-visible='true'] .eye-off { display: block; }
.auth-toggle-pw[data-visible='true'] .eye-on { display: none; }

/* Submit button */
.auth-submit {
  position: relative;
  width: 100%;
  height: 54px;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--auth-brand-dark);
  cursor: pointer;
  background: linear-gradient(135deg, #ffffff 0%, #e6f4ff 100%);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.45),
              0 0 40px -10px rgba(77, 166, 255, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  opacity: 0;
  animation: rise-in 0.4s 0.46s ease-out forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.auth-submit:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.55), 0 0 50px -8px rgba(77, 166, 255, 0.7); }
.auth-submit:hover::after { transform: translateX(100%); }
.auth-submit:active { transform: translateY(0); }
.auth-submit svg { width: 18px; height: 18px; transition: transform 0.2s; }
.auth-submit:hover svg.arrow { transform: translateX(3px); }
.auth-submit[aria-busy='true'] { pointer-events: none; opacity: 0.7; }
.auth-submit[aria-busy='true'] .auth-spinner { display: inline-block; }
.auth-submit[aria-busy='true'] .auth-submit-text,
.auth-submit[aria-busy='true'] svg.arrow { display: none; }
.auth-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(0, 40, 77, 0.25);
  border-top-color: var(--auth-brand-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error / flash */
.auth-flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--auth-danger);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97), fade-in 0.3s;
}
.auth-flash svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Footer */
.auth-foot {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(0, 212, 255, 0.16);
  text-align: center;
  font-size: 0.85rem;
  color: var(--auth-text-soft);
  opacity: 0;
  animation: fade-in 0.4s 0.55s ease-out forwards;
}
.auth-foot a { color: var(--auth-brand); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* ================================================================
   Keyframes
   ================================================================ */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { to { opacity: 1; } }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* Mobile */
@media (max-width: 480px) {
  .auth-card { padding: 32px 24px; border-radius: 22px; }
  .auth-card h2 { font-size: 1.5rem; }
  .auth-shell { padding: 16px; }
}

/* Reduce motion: disable everything decorative, keep functionality */
@media (prefers-reduced-motion: reduce) {
  .auth-blob, .auth-particles span { animation: none; }
  .auth-card, .auth-hero, .auth-logo, .auth-card h2, .auth-sub,
  .auth-field, .auth-submit, .auth-foot { animation: none; opacity: 1; transform: none; }
}

/* ================================================================
   SOFT TRAVEL — escena cielo nocturno / atardecer + wordmark + avión
   ================================================================ */
.auth-bg {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(26,140,255,0.14) 0%, transparent 60%),
    linear-gradient(180deg, #000d1a 0%, #0a2540 55%, #1a3a5c 78%, #7a4a2a 92%, #c98a4a 100%);
}
.auth-stars {
  position: absolute; inset: 0 0 40% 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 15%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 25% 30%, #fff, transparent),
    radial-gradient(1px 1px at 40% 10%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 22%, #fff, transparent),
    radial-gradient(1px 1px at 70% 8%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 85% 18%, #fff, transparent),
    radial-gradient(1px 1px at 95% 30%, #fff, transparent),
    radial-gradient(1px 1px at 15% 45%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 65% 40%, #fff, transparent),
    radial-gradient(1px 1px at 32% 50%, #fff, transparent);
  opacity: 0.55;
  pointer-events: none;
}
.auth-horizon {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(201,138,74,0) 0%, rgba(214,120,58,0.30) 55%, rgba(255,170,90,0.22) 100%);
  pointer-events: none;
}
.auth-skyline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%; height: 14%;
  min-height: 90px;
  pointer-events: none;
}

/* Wordmark */
.auth-wordmark { display: flex; flex-direction: column; gap: 4px; }
.auth-wordmark-main {
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}
.auth-wordmark-main em { color: #1a8cff; font-style: italic; }
.wm-softia { color: #2b62b0; }
.wm-travel { color: #f28c1e; }
.auth-wordmark--hero .wm-softia,
.auth-wordmark--card .wm-softia { color: #4d8fe0; } /* mas claro sobre navy para contraste */
.auth-wordmark-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--auth-text-soft);
}
.auth-wordmark--hero { margin-bottom: 26px; }
.auth-wordmark--hero .auth-wordmark-main { font-size: 2.0rem; }
.auth-wordmark--card .auth-wordmark-main { font-size: 1.5rem; }

.auth-title-plane { display: flex; align-items: center; gap: 8px; }
.auth-mini-plane { color: var(--auth-brand, #1a8cff); flex-shrink: 0; }

/* Avión animado cruzando la escena en diagonal ascendente */
.auth-plane {
  position: absolute;
  left: -14%;
  bottom: 6%;
  width: clamp(340px, 32vw, 560px);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  animation: plane-fly 18s linear infinite;
}
.auth-plane-img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 20px rgba(0, 10, 26, 0.45))
          drop-shadow(0 0 22px rgba(26, 140, 255, 0.22));
}
.auth-plane-trail-big {
  position: absolute;
  top: 78%;
  right: 74%;
  width: 55vw;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10) 55%, rgba(255,255,255,0.55));
  filter: blur(6px);
  transform: rotate(9.5deg);
  transform-origin: right center;
}
.auth-plane-trail { filter: blur(0.5px); }
@keyframes plane-fly {
  0%   { transform: translate(0, 0) scale(0.85); opacity: 0; }
  8%   { opacity: 0.9; }
  50%  { transform: translate(60vw, -32vh) scale(1); opacity: 0.9; }
  92%  { opacity: 0.9; }
  100% { transform: translate(122vw, -66vh) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-plane { animation: none; opacity: 0; }
}

@media (max-width: 1023px) {
  .auth-plane { display: none; }
}
