/* ============================================
   InspFlow — Sistema de Inspeção Industrial
   Login Page · "FORGE" — Premium Welding Theme
   EngSystem | engsystem.tec
   ============================================ */

@layer base {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    /* ── Carbon steel base ── */
    --if-steel-900:   #070A0F;   /* near-black carbon */
    --if-steel-800:   #0C111A;
    --if-steel-700:   #131A26;
    --if-steel-600:   #1C2533;

    /* ── Molten weld arc ── */
    --if-core:        #FFF6E6;   /* white-hot core */
    --if-ember:       #FF8A1E;   /* incandescent ember */
    --if-ember-hot:   #FFB454;   /* glowing edge */
    --if-orange:      #E8721A;   /* brand weld orange */
    --if-orange-dark: #B5530F;

    /* ── Forged metals ── */
    --if-copper:      #C77B45;
    --if-gold:        #E8B65A;
    --if-bronze:      #8A5A33;

    /* ── Light / text ── */
    --if-white:       #FFFFFF;
    --if-white-80:    rgba(255,250,242,0.82);
    --if-white-60:    rgba(255,248,238,0.60);
    --if-white-30:    rgba(255,246,232,0.28);
    --if-white-12:    rgba(255,255,255,0.12);
    --if-white-08:    rgba(255,255,255,0.07);

    --radius: 1.25rem;
    --radius-card: 1.75rem;

    --glow-ember: 0 0 32px rgba(255,138,30,0.35);
  }
}

/* ── Full-screen video background ── */
body.login-page {
  font-family: 'Poppins', 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--if-steel-900);
  position: relative;
}

#inspflow-bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  /* Slight warm grade + contrast so the footage reads like molten steel */
  filter: contrast(1.08) saturate(1.12) brightness(0.82);
}

/* ── Cinematic steel/forge overlay ── */
.login-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(135deg,
      rgba(7,10,15,0.82) 0%,
      rgba(12,17,26,0.55) 42%,
      rgba(7,10,15,0.78) 100%),
    /* warm arc tint from upper-left */
    radial-gradient(120% 90% at 18% 8%,
      rgba(255,138,30,0.16) 0%,
      transparent 48%);
}

/* ── Molten forge glow rising from floor + arc flash ── */
.login-forge-glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    /* molten pool glow from the bottom */
    radial-gradient(140% 60% at 50% 116%,
      rgba(255,138,30,0.30) 0%,
      rgba(232,114,26,0.12) 30%,
      transparent 62%),
    /* faint arc-flash bloom upper-right */
    radial-gradient(50% 40% at 86% 14%,
      rgba(255,180,84,0.10) 0%,
      transparent 60%);
  mix-blend-mode: screen;
  animation: forge-breathe 7s ease-in-out infinite;
}
@keyframes forge-breathe {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* ── Rising welding embers / sparks ── */
.login-embers {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.login-embers span {
  position: absolute;
  bottom: -20px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--if-ember-hot);
  box-shadow:
    0 0 6px 1px rgba(255,180,84,0.9),
    0 0 12px 2px rgba(255,138,30,0.5);
  opacity: 0;
  animation: ember-rise linear infinite;
}
@keyframes ember-rise {
  0%   { transform: translateY(0) translateX(0) scale(1);   opacity: 0; }
  8%   { opacity: 1; }
  70%  { opacity: 0.9; }
  100% { transform: translateY(-104vh) translateX(40px) scale(0.3); opacity: 0; }
}
/* Scatter the embers with per-element position / timing / size */
.login-embers span:nth-child(1)  { left: 6%;  animation-duration: 9s;  animation-delay: 0s;   }
.login-embers span:nth-child(2)  { left: 14%; animation-duration: 11s; animation-delay: 2.4s; width:2px; height:2px; }
.login-embers span:nth-child(3)  { left: 21%; animation-duration: 8s;  animation-delay: 4.1s; }
.login-embers span:nth-child(4)  { left: 28%; animation-duration: 12s; animation-delay: 1.2s; width:4px; height:4px; }
.login-embers span:nth-child(5)  { left: 35%; animation-duration: 10s; animation-delay: 5.6s; }
.login-embers span:nth-child(6)  { left: 42%; animation-duration: 9.5s;animation-delay: 3.0s; width:2px; height:2px; }
.login-embers span:nth-child(7)  { left: 49%; animation-duration: 13s; animation-delay: 0.6s; }
.login-embers span:nth-child(8)  { left: 56%; animation-duration: 8.5s;animation-delay: 6.2s; width:4px; height:4px; }
.login-embers span:nth-child(9)  { left: 63%; animation-duration: 11s; animation-delay: 2.0s; }
.login-embers span:nth-child(10) { left: 70%; animation-duration: 10s; animation-delay: 4.8s; width:2px; height:2px; }
.login-embers span:nth-child(11) { left: 77%; animation-duration: 12s; animation-delay: 1.8s; }
.login-embers span:nth-child(12) { left: 84%; animation-duration: 9s;  animation-delay: 5.1s; width:3px; height:3px; }
.login-embers span:nth-child(13) { left: 91%; animation-duration: 11.5s;animation-delay: 3.6s; }
.login-embers span:nth-child(14) { left: 11%; animation-duration: 10.5s;animation-delay: 7.0s; width:2px; height:2px; }
.login-embers span:nth-child(15) { left: 47%; animation-duration: 14s; animation-delay: 8.2s; width:4px; height:4px; }
.login-embers span:nth-child(16) { left: 66%; animation-duration: 9.8s;animation-delay: 6.8s; }
.login-embers span:nth-child(17) { left: 88%; animation-duration: 13s; animation-delay: 0.3s; width:2px; height:2px; }
.login-embers span:nth-child(18) { left: 32%; animation-duration: 12.5s;animation-delay: 9.0s; }

/* ── Cinematic vignette ── */
.login-vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 42%,
    transparent 52%,
    rgba(5,7,11,0.55) 100%);
}

/* ── Liquid Glass base classes (forged glass) ── */
@layer components {
  .liquid-glass {
    background: rgba(255,250,242,0.02);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
  }
  .liquid-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.4px;
    border-radius: inherit;
    background: linear-gradient(180deg,
      rgba(255,210,150,0.40) 0%,
      rgba(255,255,255,0.10) 22%,
      transparent 45%,
      transparent 58%,
      rgba(199,123,69,0.18) 82%,
      rgba(255,180,84,0.45) 100%);
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
  }

  /* Forged glass — frosted carbon panel with a copper/gold weld-bead edge */
  .liquid-glass-strong {
    background:
      linear-gradient(160deg,
        rgba(20,27,40,0.62) 0%,
        rgba(10,14,21,0.70) 100%);
    backdrop-filter: blur(40px) saturate(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(1.1);
    box-shadow:
      0 24px 60px rgba(0,0,0,0.55),
      inset 0 1px 1px rgba(255,255,255,0.10),
      inset 0 -40px 80px rgba(255,138,30,0.04);
    position: relative;
    overflow: hidden;
  }
  /* Weld-bead gradient border */
  .liquid-glass-strong::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: linear-gradient(150deg,
      rgba(255,214,160,0.55) 0%,
      rgba(199,123,69,0.35) 24%,
      rgba(255,255,255,0.06) 48%,
      rgba(232,182,90,0.30) 72%,
      rgba(255,180,84,0.60) 100%);
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
  }
}

/* ── Main container ── */
.login-container {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ── LEFT PANEL — Branding ── */
.login-branding {
  width: 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 56px;
  position: relative;
  animation: fade-up 0.8s cubic-bezier(0.2,0.7,0.2,1) both;
}

/* Forged glass overlay inside left panel */
.login-branding__glass {
  position: absolute;
  inset: 24px;
  border-radius: var(--radius-card);
}

.login-branding__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 460px;
  width: 100%;
  padding: 8px 12px;
}

.login-branding__logo {
  height: 104px;
  width: auto;
  margin-bottom: 36px;
  filter: drop-shadow(0 6px 24px rgba(255,138,30,0.45));
  transition: transform 0.4s cubic-bezier(0.2,0.7,0.2,1), filter 0.4s ease;
}
.login-branding__logo:hover {
  transform: scale(1.05) translateY(-2px);
  filter: drop-shadow(0 10px 30px rgba(255,138,30,0.6));
}

.login-branding__title {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--if-white);
  margin-bottom: 16px;
  line-height: 1.18;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.login-branding__title em {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  background: linear-gradient(90deg, var(--if-ember-hot), var(--if-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-branding__subtitle {
  font-size: 0.95rem;
  color: var(--if-white-60);
  margin-bottom: 36px;
  line-height: 1.65;
  max-width: 400px;
}

/* Feature pills */
.login-branding__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.login-branding__features li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.875rem;
  color: var(--if-white-80);
  padding: 12px 18px;
  border-radius: 999px;
  text-align: left;
  transition: transform 0.2s ease, background 0.2s ease;
}
.login-branding__features li:hover {
  transform: translateX(6px);
  background: rgba(255,138,30,0.06);
}
.login-branding__features li i {
  color: var(--if-ember);
  font-size: 1.05rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255,138,30,0.5));
}

/* Brand signature at bottom */
.login-branding__signature {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.login-branding__signature-label {
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--if-white-60);
}
.login-branding__signature-text {
  font-size: 0.82rem;
  color: var(--if-white-80);
  font-style: italic;
  font-family: 'Source Serif 4', Georgia, serif;
}
.login-branding__signature-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--if-copper);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 8px;
}
.login-branding__signature-divider::before,
.login-branding__signature-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--if-copper), transparent);
  min-width: 48px;
}

/* ── RIGHT PANEL — Login Form ── */
.login-form-panel {
  width: 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 48px;
}

/* Glass card wrapping the form */
.login-card {
  width: 100%;
  max-width: 440px;
  padding: 44px 40px;
  border-radius: var(--radius-card);
  color: var(--if-white);
  animation: fade-up 0.7s cubic-bezier(0.2,0.7,0.2,1) 0.1s both;
}

/* Glowing weld-seam accent across the top of the card */
.login-card__header {
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  padding-top: 6px;
}
.login-card__header::before {
  content: '';
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--if-ember), var(--if-ember-hot), var(--if-ember), transparent);
  box-shadow: 0 0 16px rgba(255,138,30,0.8);
}
.login-card__label {
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--if-ember-hot);
  font-weight: 600;
}
.login-card__title {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--if-white);
  margin: 8px 0 6px;
  letter-spacing: -0.03em;
}
.login-card__description {
  font-size: 0.875rem;
  color: var(--if-white-60);
}

/* Form groups */
.form-group {
  margin-bottom: 18px;
  position: relative;
}
.form-group--password { margin-bottom: 22px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--if-white-80);
  margin-bottom: 7px;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid var(--if-white-12) !important;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 0.9rem;
  color: var(--if-white) !important;
  font-family: 'Poppins', sans-serif;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.form-control::placeholder { color: var(--if-white-30); }
.form-control:hover {
  border-color: rgba(255,180,84,0.35) !important;
}
.form-control:focus {
  outline: none;
  background: rgba(255,255,255,0.09) !important;
  border-color: var(--if-ember) !important;
  box-shadow:
    0 0 0 3px rgba(255,138,30,0.18),
    0 0 22px rgba(255,138,30,0.22) !important;
  color: var(--if-white) !important;
}
.form-control--password { padding-right: 46px; }
.form-control--error {
  border-color: rgba(229,72,72,0.75) !important;
  box-shadow: 0 0 0 3px rgba(229,72,72,0.18) !important;
}

/* Password toggle button */
.password-toggle {
  position: absolute;
  right: 14px;
  bottom: 13px;
  background: none;
  border: none;
  color: var(--if-white-60);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.password-toggle:hover { color: var(--if-ember-hot); }

/* Submit button — molten metal */
.btn-primary {
  width: 100%;
  padding: 14px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: #2A1403;
  background: linear-gradient(180deg, var(--if-ember-hot) 0%, var(--if-orange) 52%, var(--if-orange-dark) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.3px;
  transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.2s;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 22px rgba(232,114,26,0.40),
    inset 0 1px 0 rgba(255,255,255,0.45);
}
/* White-hot sheen sweeping across like a heated edge */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
}
.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow:
    0 12px 30px rgba(255,138,30,0.55),
    0 0 36px rgba(255,138,30,0.35),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary i { font-size: 1.05rem; }

/* Forgot link */
.form-footer {
  margin-top: 16px;
  text-align: center;
}
.forgot-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--if-white-60);
  text-decoration: none;
  transition: color 0.15s;
}
.forgot-link:hover { color: var(--if-ember-hot); }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 20px;
  color: var(--if-white-30);
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--if-white-30), transparent);
}

/* Access options pills */
.access-options {
  display: flex;
  gap: 12px;
}
.access-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--radius);
  cursor: default;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--if-white-08);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.access-option:hover {
  transform: translateY(-3px);
  border-color: rgba(255,180,84,0.4);
  background: rgba(255,138,30,0.06);
}
.access-option__icon {
  font-size: 1.5rem;
  color: var(--if-ember);
  margin-bottom: 8px;
  filter: drop-shadow(0 0 8px rgba(255,138,30,0.45));
}
.access-option__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--if-white-80);
  margin-bottom: 2px;
}
.access-option__desc {
  font-size: 0.7rem;
  color: var(--if-white-60);
}

/* Alert override for login page */
.alert-danger {
  background: rgba(229,72,72,0.12) !important;
  border-left: 4px solid #E54848 !important;
  border-radius: 10px !important;
  color: #FCA5A5 !important;
  border: none;
  margin-bottom: 20px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Entrance animation */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile: single-panel stacked layout ── */
@media (max-width: 991px) {
  .login-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
  }

  .login-branding {
    width: 100%;
    padding: 32px 24px 24px;
  }
  .login-branding__glass { inset: 12px; }
  .login-branding__title { font-size: 1.55rem; }
  .login-branding__logo  { height: 84px; margin-bottom: 24px; }

  .login-form-panel {
    width: 100%;
    padding: 0 0 32px;
  }
  .login-card { max-width: 100%; }
}

@media (max-width: 480px) {
  .login-branding { display: none; }
  .login-form-panel {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 24px 16px;
  }
  .login-card { padding: 36px 26px; }
  .access-options { flex-direction: column; }
}

/* ── Accessibility: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .login-embers,
  .login-forge-glow { animation: none; }
  .login-embers span { display: none; }
  .login-branding,
  .login-card { animation: none; }
  .btn-primary::after { transition: none; }
}

/* ── Focus visibility ── */
:focus-visible {
  outline: 2px solid var(--if-ember-hot);
  outline-offset: 2px;
}
