/* ============================================================
   IT Helpdesk - Login Page Stylesheet
   PT. Kawasan Industri Wijayakusuma
   ============================================================
   Structure:
   1. Variables
   2. Base
   3. Layout
   4. Branding Panel
   5. Login Form
   6. Components
   7. Utilities
   8. Responsive
   ============================================================ */

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

/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
  /* Brand colors */
  --navy-950:   #020C1B;
  --navy-900:   #0A1628;
  --navy-800:   #0E2040;
  --blue-600:   #1347C8;
  --blue-500:   #1E5FE8;
  --cyan-400:   #22D3EE;
  --red-400:    #F87171;

  /* Neutrals */
  --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-900:   #0F172A;

  /* Elevation */
  --shadow-sm:  0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md:  0 4px 12px rgba(15, 23, 42, .08);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;

  /* Motion */
  --transition: all .15s ease;

  --font-sans:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

/* ============================================================
   2. BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--gray-50);
}

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

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

/* Background: one mesh gradient, one soft glow orb. Nothing else. */
.bg-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.bg-mesh {
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(30, 95, 232, .22) 0%, transparent 65%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-800) 60%, var(--navy-900) 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  width: 460px;
  height: 460px;
  background: rgba(34, 211, 238, .10);
  top: -140px;
  right: -140px;
}

.branding-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Logo bar */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo-img {
  height: 34px;
  filter: brightness(0) invert(1);
  opacity: .95;
}
.brand-logo-sep {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, .18);
  flex-shrink: 0;
}
.brand-logo-name {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .92);
  letter-spacing: -.01em;
}
.brand-logo-dept {
  font-size: .7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .38);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Illustration — static, no floating animation */
.brand-illustration svg { width: 100%; max-width: 340px; }

/* Headline — short, no marketing copy */
.brand-headline {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.brand-title {
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.25;
  letter-spacing: -.02em;
}
.brand-subtitle {
  font-size: .85rem;
  color: rgba(255, 255, 255, .5);
  line-height: 1.6;
  font-weight: 400;
  max-width: 320px;
}

/* ============================================================
   5. 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;
}

.form-container {
  width: 100%;
  max-width: 380px;
  opacity: 0;
  animation: formEntrance .4s ease-out .05s forwards;
}

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

.form-header { margin-bottom: 2rem; }

.form-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .4rem;
}

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

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

.field-label { margin-bottom: 6px; }
.field-label-text {
  font-size: .78rem;
  font-weight: 500;
  color: var(--gray-700);
}

.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;
  z-index: 2;
  display: flex;
}
.field-control {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 40px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 400;
  color: var(--gray-900);
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.field-control::placeholder { color: var(--gray-400); font-weight: 400; }
.field-control:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30, 95, 232, .12);
}
.field-control.is-invalid {
  border-color: var(--red-400);
  background: #FFFAFA;
}
.field-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .12);
}

.btn-pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 5px;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition);
  z-index: 3;
}
.btn-pw-toggle:hover { color: var(--gray-600); background: var(--gray-100); }

.field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: .76rem;
  color: var(--red-400);
  font-weight: 500;
}

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

/* ============================================================
   6. COMPONENTS
   ============================================================ */

/* Primary button */
.btn-login {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--blue-500);
  color: var(--white);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .15s ease;
}
.btn-login:hover { background: var(--blue-600); }
.btn-login:active { background: var(--navy-800); }
.btn-login:disabled,
.btn-login.is-loading {
  pointer-events: none;
  opacity: .8;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spinCW .7s linear infinite;
  display: none;
  flex-shrink: 0;
}
.btn-login.is-loading .btn-text    { display: none; }
.btn-login.is-loading .btn-spinner { display: flex; }

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

/* Alert */
.alert-danger {
  background: #FFF5F5;
  border: 1px solid #FDD;
  color: var(--red-400);
}

/* 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: 400;
  white-space: nowrap;
}
.auth-page-footer span { color: var(--gray-500); font-weight: 500; }

/* ============================================================
   7. UTILITIES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============================================================
   8. 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-subtitle { margin: 0 auto; }
  .brand-illustration { display: none; }
  .brand-title { font-size: 1.4rem; }
  .branding-content { gap: 1.5rem; align-items: center; }
  .brand-logo { justify-content: center; }
  .orb { width: 280px; height: 280px; top: -80px; right: -80px; }

  .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.25rem; }
  .form-title { font-size: 1.35rem; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .form-container { animation: none; opacity: 1; }
  .btn-spinner { animation: spinCW 1s linear infinite; }
}
