/* ============================================================
   Login Portal — Sistema Soporte TI · TAMA
   Adapted from index_nuevo design
   ============================================================ */

:root {
  --card-radius: 12px;
  --accent:      #a1e908;   /* verde claro */
  --accent-dark: #7bb106;
  --accent2:     #a1e908;   /* verde claro */
  --muted:       #6c757d;
  --bg-1:        #fff8f2;
}

/* ── Body ────────────────────────────────────────────────── */
body.login-portal {
  background:
    radial-gradient(ellipse 80% 60% at 80% 20%, rgba(161,233,8,0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 80%, rgba(123,177,6,0.15), transparent 50%),
    linear-gradient(150deg, #1c0a03 0%, #223a0a 35%, #1a2c04 70%, #0e1a03 100%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* permitir scroll en móviles cuando el teclado empuja el contenido */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  position: relative;
  overflow-x: hidden;
}

/* ── Portal frame ────────────────────────────────────────── */
.portal-frame {
  max-width: 1060px;
  width: 100%;
  border-radius: 18px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  position: relative;
  /* entrance animation start */
  transform: translateY(8px);
  opacity: 0;
  transition: transform .5s ease, opacity .5s ease;
}
.portal-frame.visible { transform: translateY(0); opacity: 1; }

/* decorative accent circle – warm glow */
.portal-frame::before {
  content: '';
  position: absolute;
  right: -120px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%,
    rgba(161,233,8,0.22),
    rgba(123,177,6,0.08) 40%,
    transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Inner frame border ──────────────────────────────────── */
.portal-frame-inner {
  border-radius: 12px;
  padding: 18px;
  border: 2px solid rgba(255,255,255,0.06);
}

/* ── Login card (two columns) ────────────────────────────── */
.login-card {
  display: flex;
  overflow: hidden;
  border-radius: 12px;
  background: transparent;
  position: relative;
  min-height: 520px;
}

/* ── Left panel – dining visual ──────────────────────────── */
.login-left {
  flex: 1;
  min-width: 320px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(161,233,8,0.25), transparent 65%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(123,177,6,0.18), transparent 55%),
    linear-gradient(155deg, #1c2a03 0%, #3b4e04 45%, #203d05 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Subtle texture overlay – soft dot pattern */
.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(161,233,8,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Floating tech icon decoration inside left panel */
.login-left-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-left-brand {
  color: #fff;
  font-weight: 800;
  font-size: 2.1rem;
  letter-spacing: -.5px;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.login-left-brand span {
  display: block;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,200,130,.65);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 6px;
}

.login-left-icon-ring {
  width: 110px; height: 110px;
  border-radius: 50%;
    border: 2px solid rgba(161,233,8,0.5);
    box-shadow: 0 0 50px rgba(161,233,8,0.25), inset 0 0 30px rgba(161,233,8,0.12);
    display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
    color: rgba(161,233,8,.9);
  background: rgba(161,233,8,0.08);
}

.login-left-pills {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 240px;
}
.login-left-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(161,233,8,0.18);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(161,233,8,.8);
  font-size: .82rem;
}
.login-left-pill i {
  font-size: .95rem;
  color: var(--accent2);
  width: 18px;
  text-align: center;
  filter: drop-shadow(0 0 5px rgba(161,233,8,0.55));
}

/* ── Right panel – form ──────────────────────────────────── */
.login-right {
  width: 380px;
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
  padding: 32px 30px;
  margin-left: 28px;
  z-index: 3;
  align-self: center;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 22px 60px rgba(0,0,0,0.25);
}

.login-right h3 { color: #1f1f1f; margin-bottom: 6px; font-weight: 800; }
.login-right .small { color: #666; }

/* Logo badge */
.login-right .logo {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f4ff 100%);
  color: #222;
  font-weight: 800;
  font-size: 1.12rem;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(12,18,24,0.10);
  border: 1px solid rgba(26,86,219,0.10);
  margin-bottom: 16px;
  transition: transform .22s cubic-bezier(.2,.9,.2,1), box-shadow .22s ease;
  position: relative;
  z-index: 80;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .36s ease, transform .36s ease;
}
.login-right .logo.entered { opacity: 1; transform: translateY(0); }
.login-right .logo:hover { transform: translateY(-4px); box-shadow: 0 26px 60px rgba(12,18,24,0.12); }

/* Logo image / icon in badge */
.login-right .logo::before {
  content: '';
  width: 44px; height: 44px;
  border-radius: 10px;
  background-image: url('/soporte/assets/img/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fff8f2;
  box-shadow: 0 6px 18px rgba(192,57,43,0.12);
  flex: 0 0 44px;
}

.login-right .logo .subtitle {
  display: block;
  font-size: .82rem;
  color: #8a8a8a;
  font-weight: 600;
  margin-top: 2px;
}

/* Headline */
.headline-wrap {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.hl-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 44px;
  box-shadow: 0 6px 18px rgba(192,57,43,0.28);
  color: #fff;
  font-size: 1.2rem;
}
.headline {
  font-size: 1.45rem; margin: 0; color: #1f1f1f;
  font-weight: 800; letter-spacing: -.4px;
  display: flex; align-items: center; gap: 10px;
}
.headline::after {
  content: '';
  display: block; height: 5px; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  flex: 1; margin-left: 8px; opacity: .85;
}
.hl-sub { font-size: .88rem; color: #8a8a8a; font-weight: 600; margin-left: 6px; }

/* Form labels */
.login-right .form-label {
  color: #333; font-weight: 700; margin-bottom: 6px; display: block;
}

/* Form controls */
.login-right .form-control {
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: #222;
  padding: .65rem .9rem;
  height: 46px;          /* tap target cómodo */
  font-size: 1rem;       /* evita zoom en iOS */
  transition: border-color .2s, box-shadow .2s;
}
.login-right .form-control::placeholder { color: #aaa; }
.login-right .form-control:focus {
  outline: none;
  box-shadow: 0 8px 24px rgba(26,86,219,0.10);
  border-color: var(--accent);
}

/* CTA button */
.login-right .btn-cta {
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border: none;
  color: #fff;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  width: 100%;
  font-size: 1rem;
  height: 50px;          /* tap target mínimo */
  box-shadow: 0 8px 24px rgba(192,57,43,0.30);
  transition: filter .15s, transform .15s;
  cursor: pointer;
  touch-action: manipulation; /* elimina delay de 300ms en móvil */
}
.login-right .btn-cta:hover:not(:disabled) {
  filter: brightness(.95);
  transform: translateY(-1px);
}
.login-right .btn-cta:disabled { opacity: .7; cursor: not-allowed; }
.login-right .btn-cta i { opacity: .95; }

/* Staged reveal */
.staged {
  opacity: 0; transform: translateY(10px);
  transition: opacity .36s ease, transform .36s ease;
}
.staged.visible { opacity: 1; transform: none; }

/* Alert */
#loginAlert {
  display: none;
  border-radius: 8px;
  font-size: .9rem;
  padding: 10px 14px;
  margin-bottom: 14px;
}

/* Social row (hidden for soporte) */
.social-row { display: none; }

/* Toggle password button */
#togglePwd {
  position: absolute;
  right: 8px; top: 34px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  color: #777;
  font-size: .8rem;
  padding: .25rem .55rem;
  cursor: pointer;
  transition: background .15s;
}
#togglePwd:hover { background: #f0f4ff; color: var(--accent); }

/* Footer note */
.login-footer-note {
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: .78rem;
  margin-top: 18px;
}

/* Spinner for submit */
.btn-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.9);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Falling particles (tech icons) ─────────────────────── */
.fall-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.falling-icon {
  position: absolute;
  top: -60px;
  opacity: 0;
  animation: fall-down linear forwards;
  color: rgba(212,86,0,0.30);
  font-size: 22px;
}
@keyframes fall-down {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: .6; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ── Responsive ──────────────────────────────────────────── */

/* Tablet landscape: reducir panel izquierdo */
@media (max-width: 1024px) {
  .login-left { min-width: 260px; }
  .login-right { width: 360px; }
  .portal-frame { padding: 20px; }
}

/* Tablet portrait: panel izq más compacto */
@media (max-width: 860px) {
  .login-left { min-width: 220px; }
  .login-left-brand { font-size: 1.6rem; }
  .login-left-pills { max-width: 210px; }
  .login-right { width: 100%; margin-left: 14px; }
  .portal-frame { padding: 16px; }
  .portal-frame-inner { padding: 12px; }
}

/* Móvil grande (640px): ocultar panel izquierdo, centrar formulario */
@media (max-width: 640px) {
  .login-wrapper { padding: 16px 12px; align-items: flex-start; padding-top: 24px; }

  .portal-frame {
    padding: 0;
    border-radius: 20px;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  .portal-frame::before { display: none; }

  .portal-frame-inner {
    padding: 0;
    border: none;
  }

  .login-left { display: none; }

  .login-card {
    display: block;
    border-radius: 20px;
    min-height: unset;
  }

  .login-right {
    width: 100%;
    margin-left: 0;
    border-radius: 20px;
    padding: 28px 24px 24px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  }

  /* Previene zoom automático en iOS al enfocar inputs */
  .login-right .form-control {
    font-size: 16px !important;
    height: 48px;
  }

  /* Tap targets más grandes para móvil */
  .login-right .btn-cta {
    height: 52px;
    font-size: 1.05rem;
    border-radius: 12px;
  }

  #togglePwd {
    top: 36px;
    padding: .3rem .65rem;
  }

  .login-right .logo {
    font-size: 1rem;
    padding: 10px 12px;
  }

  .headline { font-size: 1.3rem; }
  .headline::after { display: none; }
  .hl-icon { width: 38px; height: 38px; font-size: 1.05rem; flex: 0 0 38px; }

  .login-footer-note { font-size: .75rem; margin-top: 14px; }
}

/* Móvil pequeño (420px) */
@media (max-width: 420px) {
  .login-wrapper { padding: 12px 10px; padding-top: 16px; }

  .login-right {
    padding: 24px 18px 20px;
    border-radius: 16px;
  }

  .login-right .logo {
    font-size: .95rem;
    padding: 9px 11px;
    margin-bottom: 12px;
  }
  .login-right .logo::before { width: 36px; height: 36px; flex: 0 0 36px; }

  .headline { font-size: 1.15rem; gap: 8px; }
  .hl-sub { font-size: .82rem; }

  .login-right .form-label { font-size: .88rem; }
  .login-right .form-control { font-size: 16px !important; height: 46px; padding: .6rem .8rem; }

  .login-right .btn-cta { height: 50px; font-size: 1rem; }

  #togglePwd { font-size: .75rem; padding: .25rem .5rem; }
}

/* Pantallas muy pequeñas (360px) */
@media (max-width: 360px) {
  .login-right { padding: 20px 15px; }
  .headline-wrap { gap: 8px; }
  .hl-icon { width: 34px; height: 34px; font-size: 1rem; flex: 0 0 34px; }
  #togglePwd { display: none; }
}

/* Desktop grande: ampliar panel izquierdo */
@media (min-width: 1200px) {
  .login-left { min-width: 380px; }
  .login-right { width: 400px; padding: 36px 34px; }
  .portal-frame { padding: 32px; }
  .portal-frame-inner { padding: 22px; }
}
