/* ============================================================
   IT Helpdesk - Login Page Stylesheet
   PT. Kawasan Industri Wijayakusuma
   ============================================================ */

/*  CSS Variables  */
:root {
  --navy-950:   #020C1B;
  --navy-900:   #0A1628;
  --navy-800:   #0E2040;
  --navy-700:   #142E58;
  --navy-600:   #1B3A70;
  --blue-600:   #1347C8;
  --blue-500:   #1E5FE8;
  --blue-400:   #3B7BFF;
  --blue-300:   #7AAAFF;
  --cyan-500:   #06B6D4;
  --cyan-400:   #22D3EE;
  --cyan-300:   #67E8F9;
  --green-400:  #4ADE80;
  --amber-400:  #FBBF24;
  --red-400:    #F87171;

  --white:      #FFFFFF;
  --gray-50:    #F8FAFD;
  --gray-100:   #F1F5F9;
  --gray-200:   #E2E8F0;
  --gray-300:   #CBD5E1;
  --gray-400:   #94A3B8;
  --gray-500:   #64748B;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1E293B;
  --gray-900:   #0F172A;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.16), 0 4px 12px rgba(0,0,0,.08);
  --shadow-blue:0 8px 32px rgba(30,95,232,.32);
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  --transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

/*  Reset & Base  */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--gray-50);
}

/*  Wrapper  */
.auth-wrapper {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

/* ============================================================
   LEFT PANEL — Branding
   ============================================================ */
.auth-branding {
  position: relative;
  background: var(--navy-900);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 3.75rem;
  overflow: hidden;
}

/* — Animated Background — */
.bg-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.bg-mesh {
  background:
    radial-gradient(ellipse 70% 55% at 15% 45%, rgba(30,95,232,.28) 0%, transparent 65%),
    radial-gradient(ellipse 55% 70% at 85% 15%, rgba(34,211,238,.14) 0%, transparent 55%),
    radial-gradient(ellipse 45% 50% at 55% 95%, rgba(19,71,200,.35) 0%, transparent 60%),
    linear-gradient(145deg, var(--navy-950) 0%, var(--navy-800) 55%, var(--navy-900) 100%);
}

.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}

/* Glowing orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.orb-1 {
  width: 520px; height: 520px;
  background: rgba(30,95,232,.18);
  top: -160px; right: -160px;
  animation: orbDrift 12s ease-in-out infinite;
}
.orb-2 {
  width: 360px; height: 360px;
  background: rgba(34,211,238,.1);
  bottom: -60px; left: -80px;
  animation: orbDrift 10s ease-in-out infinite reverse;
  animation-delay: -4s;
}
.orb-3 {
  width: 240px; height: 240px;
  background: rgba(59,123,255,.12);
  top: 50%; left: 55%;
  animation: orbDrift 8s ease-in-out infinite;
  animation-delay: -2s;
}

@keyframes orbDrift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(20px,-30px) scale(1.06); }
  66%       { transform: translate(-15px,20px) scale(.96); }
}

/* Geometric circles */
.geo-ring {
  position: absolute;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 50%;
}
.geo-ring-1 {
  width: 560px; height: 560px;
  right: -180px; top: -140px;
  animation: rotateCCW 40s linear infinite;
}
.geo-ring-2 {
  width: 340px; height: 340px;
  right: -60px; top: -20px;
  border-color: rgba(34,211,238,.07);
  animation: rotateCW 28s linear infinite;
}
.geo-ring-3 {
  width: 180px; height: 180px;
  right: 60px; top: 100px;
  border-color: rgba(255,255,255,.04);
  animation: rotateCCW 20s linear infinite;
}

@keyframes rotateCW  { to { transform: rotate(360deg);  } }
@keyframes rotateCCW { to { transform: rotate(-360deg); } }

/* Particle canvas */
#particleCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

/* — Branding Content — */
.branding-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* Logo bar */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo-img {
  height: 36px;
  filter: brightness(0) invert(1);
  opacity: .95;
}
.brand-logo-sep {
  width: 1px; height: 26px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}
.brand-logo-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: -.01em;
}
.brand-logo-dept {
  font-size: .7rem;
  font-weight: 500;
  color: rgba(255,255,255,.35);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Illustration */
.brand-illustration {
  animation: floatY 6s ease-in-out infinite;
}
.brand-illustration svg { width: 100%; max-width: 380px; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* Headline */
.brand-headline {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.brand-pretitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cyan-400);
}
.brand-pretitle::before {
  content: '';
  display: block;
  width: 20px; height: 1.5px;
  background: var(--cyan-400);
  border-radius: 2px;
}
.brand-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.18;
  letter-spacing: -.035em;
}
.brand-title .accent {
  background: linear-gradient(130deg, var(--cyan-300) 0%, var(--blue-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-subtitle {
  font-size: .875rem;
  color: rgba(255,255,255,.48);
  line-height: 1.65;
  font-weight: 400;
  max-width: 360px;
}

/* ============================================================
   RIGHT PANEL — Login Form
   ============================================================ */
.auth-form-panel {
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2.75rem;
  position: relative;
  overflow: hidden;
}

/* Top accent line */
.auth-form-panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-500) 0%, var(--cyan-400) 100%);
}

/* Decorative bg */
.form-bg-blob {
  position: absolute;
  pointer-events: none;
}
.form-bg-blob-1 {
  bottom: -180px; right: -180px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(30,95,232,.05) 0%, transparent 70%);
}
.form-bg-blob-2 {
  top: -100px; left: -100px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(34,211,238,.04) 0%, transparent 70%);
}

/* Form container */
.form-container {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: formEntrance .75s cubic-bezier(.16,1,.3,1) .1s forwards;
}

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

/* — Form Header — */
.form-header { margin-bottom: 2.25rem; }

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(30,95,232,.07);
  border: 1px solid rgba(30,95,232,.18);
  border-radius: 100px;
  padding: 5px 13px 5px 9px;
  margin-bottom: 1.25rem;
}
.badge-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue-500);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30,95,232,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(30,95,232,0); }
}
.badge-text {
  font-size: .69rem;
  font-weight: 700;
  color: var(--blue-500);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.form-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.035em;
  line-height: 1.18;
  margin-bottom: .45rem;
}
.form-title span {
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-subtitle {
  font-size: .875rem;
  color: var(--gray-500);
  line-height: 1.6;
  font-weight: 400;
}

/* — Input Fields — */
.field-group { margin-bottom: 1.1rem; }

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.field-label-text {
  font-size: .76rem;
  font-weight: 700;
  color: var(--gray-700);
  letter-spacing: .015em;
}
.field-required {
  font-size: .7rem;
  color: var(--red-400);
  font-weight: 600;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-left {
  position: absolute;
  left: 14px;
  color: var(--gray-400);
  font-size: 1rem;
  pointer-events: none;
  transition: color .2s;
  z-index: 2;
  display: flex;
}
.field-control {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 42px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: 'Manrope', sans-serif;
  font-size: .88rem;
  font-weight: 500;
  color: var(--gray-900);
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.field-control::placeholder { color: var(--gray-400); font-weight: 400; }
.field-control:hover {
  border-color: var(--gray-300);
  background: var(--white);
}
.field-control:focus {
  background: var(--white);
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(30,95,232,.09);
}
.field-control:focus ~ .input-icon-left,
.input-wrap:focus-within .input-icon-left {
  color: var(--blue-500);
}
.field-control.is-invalid {
  border-color: var(--red-400);
  background: #FFF8F8;
}
.field-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(248,113,113,.1);
}

/* Password toggle */
.btn-pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 5px;
  border-radius: 6px;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition);
  z-index: 3;
}
.btn-pw-toggle:hover { color: var(--blue-500); background: rgba(30,95,232,.07); }

/* Error message */
.field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: .75rem;
  color: var(--red-400);
  font-weight: 600;
}

/* — Remember row — */
.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.check-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.check-input {
  width: 16px; height: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 5px;
  accent-color: var(--blue-500);
  cursor: pointer;
  transition: var(--transition);
}
.check-label {
  font-size: .82rem;
  color: var(--gray-600);
  font-weight: 500;
  cursor: pointer;
}

/* — Submit Button — */
.btn-login {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-500) 0%, #1347C8 100%);
  color: var(--white);
  font-family: 'Manrope', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.btn-login::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  transition: left .5s;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue);
}
.btn-login:hover::before { left: 100%; }
.btn-login:active { transform: translateY(0); box-shadow: none; }
.btn-login:disabled,
.btn-login.is-loading {
  pointer-events: none;
  opacity: .8;
}

/* Loading spinner */
.btn-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spinCW .75s linear infinite;
  display: none;
  flex-shrink: 0;
}
.btn-login.is-loading .btn-text  { display: none; }
.btn-login.is-loading .btn-spinner { display: block; }
.btn-login.is-loading .btn-icon  { display: none; }

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

/* — Security Footer — */
.security-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 1.35rem;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
.security-text {
  font-size: .72rem;
  color: var(--gray-400);
  font-weight: 500;
}
.security-dot {
  width: 4px; height: 4px;
  background: var(--gray-300);
  border-radius: 50%;
  flex-shrink: 0;
}

/* — Page Footer — */
.auth-page-footer {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: .7rem;
  color: var(--gray-400);
  font-weight: 500;
  white-space: nowrap;
}
.auth-page-footer span { color: var(--gray-500); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .auth-wrapper { grid-template-columns: 1fr 1.1fr; }
  .auth-branding { padding: 3rem 2.75rem; }
}

@media (max-width: 820px) {
  .auth-wrapper { grid-template-columns: 1fr; overflow-y: auto; }
  body { overflow-y: auto; }

  .auth-branding {
    padding: 2.5rem 2rem 2rem;
    min-height: auto;
    align-items: center;
    text-align: center;
  }
  .brand-pretitle { justify-content: center; }
  .brand-pretitle::before { display: none; }
  .brand-subtitle { margin: 0 auto; }
  .brand-illustration { display: none; }
  .brand-title { font-size: 1.7rem; }
  .branding-content { gap: 1.5rem; align-items: center; }
  .brand-logo { justify-content: center; }
  .geo-ring-1, .geo-ring-2, .geo-ring-3 { display: none; }
  .orb-1 { width: 300px; height: 300px; top: -80px; right: -80px; }
  .orb-2 { display: none; }

  .auth-form-panel { padding: 2.5rem 2rem; min-height: 100vh; }
  .auth-page-footer { position: relative; bottom: auto; left: auto; transform: none; margin-top: 2rem; }
}

@media (max-width: 480px) {
  .auth-branding { padding: 2rem 1.5rem; }
  .auth-form-panel { padding: 2rem 1.25rem; }
  .brand-title { font-size: 1.5rem; }
  .form-title { font-size: 1.6rem; }
}
