/* ================================================================
   INVENTORYHUB — login.css (Light Mode)
   Tema putih bersih profesional dengan aksen Royal Blue
   ================================================================ */

/* ── 1. Tokens ─────────────────── */
:root {
  --bg:            #f8fafc;
  --bg-card:       #ffffff;
  
  --primary:       #1d4ed8;  /* Royal Blue */
  --primary-dim:   #eff6ff;
  --primary-border:#bfdbfe;
  --cyan:          #3b82f6;
  
  --red:           #ef4444;
  --red-dim:       #fef2f2;
  --red-border:    #fecaca;

  --text-primary:  #0f172a;
  --text-soft:     #475569;
  --text-muted:    #64748b;

  --border:        #e2e8f0;
  --focus-glow:    rgba(29, 78, 216, 0.15);

  --input-bg:      #f1f5f9;
  --input-border:  #cbd5e1;

  --radius-card:   22px;
  --radius-input:  11px;
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Noise texture super tipis untuk tekstur kertas/elegan */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.04; mix-blend-mode: multiply;
}

/* ── 3. Grid overlay ──────────────────────── */
.grid-pattern {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(29,78,216,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,78,216,0.03) 1px, transparent 1px);
  background-size: 54px 54px;
}

/* ── 4. Ambient orbs ──────────────────────── */
.orb {
  position: fixed; border-radius: 50%; filter: blur(100px);
  z-index: 0; pointer-events: none; opacity: 0.5;
}
.orb-1 {
  width: 400px; height: 400px; top: -100px; left: -100px;
  background: radial-gradient(circle, rgba(59,130,246,0.15), transparent 70%);
  animation: driftA 18s ease-in-out infinite alternate;
}
.orb-2 {
  width: 300px; height: 300px; bottom: -80px; right: -80px;
  background: radial-gradient(circle, rgba(29,78,216,0.12), transparent 70%);
  animation: driftB 22s ease-in-out infinite alternate;
}
@keyframes driftA { from { transform: translate(0,0) scale(1); } to { transform: translate(30px, 20px) scale(1.05); } }
@keyframes driftB { from { transform: translate(0,0) scale(1); } to { transform: translate(-20px,-30px) scale(1.03); } }

/* ── 5. Page layout ───────────────────────────────────────────── */
.page {
  position: relative; z-index: 1; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}

/* ── 6. Card (Light Mode Style) ───────────────────────────────── */
.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 44px 40px 40px;
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.04),
    0 1px 3px rgba(0,0,0,0.02);
  animation: cardReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── 7. Logo (Diubah Jadi Center & Bulet) ─────────────────────── */
.logo-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center; 
  gap: 12px; text-align: center; margin-bottom: 28px;
  animation: fadeUp 0.6s 0.1s var(--ease) both;
}

.logo-image-box {
  width: 64px; height: 64px;
  background: var(--primary-dim);
  border: 2px solid var(--primary-border);
  border-radius: 50%; /* Membuat kotak jadi lingkaran */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(29,78,216,0.1);
}

.logo-image-box img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Placeholder tulisan saat gambar belum ada */
.logo-placeholder {
  font-size: 0.75rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.logo-texts { display: flex; flex-direction: column; gap: 2px; }

.logo-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text-primary); line-height: 1;
}
.logo-name .accent { color: var(--primary); }

.logo-tagline {
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}

/* ── 8. Divider ───────────────────────────────────────────────── */
.card-divider {
  width: 100%; height: 1px; background: var(--border);
  margin-bottom: 26px; animation: fadeUp 0.6s 0.15s var(--ease) both;
}

/* ── 9. Headline & sub ────────────────────────────────────────── */
.card-headline {
  font-family: 'Syne', sans-serif;
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text-primary); margin-bottom: 5px; text-align: center;
  animation: fadeUp 0.6s 0.18s var(--ease) both;
}
.card-sub {
  font-size: 0.85rem; color: var(--text-muted); text-align: center;
  margin-bottom: 24px; animation: fadeUp 0.6s 0.22s var(--ease) both;
}

/* ── 10. Flash/error banner ───────────────────────────────────── */
.flash-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: 10px;
  font-size: 0.8rem; margin-bottom: 16px; font-weight: 500;
}
.flash-error {
  background: var(--red-dim); border: 1px solid var(--red-border); color: var(--red);
}

/* ── 11. Form ─────────────────────────────────────────────────── */
.login-form { animation: fadeUp 0.6s 0.26s var(--ease) both; }
.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 7px;
}

/* ── 12. Input wrap ───────────────────────────────────────────── */
.input-wrap { position: relative; display: flex; align-items: center; }

.input-icon {
  position: absolute; left: 14px; color: #94a3b8; pointer-events: none;
  display: flex; transition: color 0.22s;
}
.input-wrap:focus-within .input-icon { color: var(--primary); }

.input-wrap input {
  width: 100%; padding: 13px 13px 13px 42px;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: var(--radius-input); color: var(--text-primary);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500;
  outline: none; transition: all 0.2s; -webkit-appearance: none;
}
.input-wrap input::placeholder { color: #94a3b8; font-weight: 400; }
.input-wrap input:focus {
  border-color: var(--primary); background: #ffffff;
  box-shadow: 0 0 0 3px var(--focus-glow);
}
#id_password { padding-right: 42px; }

/* ── 13. Password toggle ──────────────────────────────────────── */
.toggle-pw {
  position: absolute; right: 12px; background: none; border: none;
  color: #94a3b8; cursor: pointer; padding: 4px; display: flex; transition: color 0.2s;
}
.toggle-pw:hover { color: var(--primary); }

/* ── 14. Remember me ──────────────────────────────────────────── */
.remember-row { display: flex; align-items: center; gap: 9px; margin: 16px 0 20px; }
.remember-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px;
  border: 1.5px solid var(--input-border); border-radius: 5px; background: #fff;
  cursor: pointer; position: relative; flex-shrink: 0; transition: all 0.2s;
}
.remember-row input[type="checkbox"]:checked {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(29,78,216,0.3);
}
.remember-row input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px;
  width: 4px; height: 8px; border: 2px solid #fff; border-top: none; border-left: none;
  transform: rotate(45deg);
}
.remember-row label {
  font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; user-select: none;
}

/* ── 15. Submit button ────────────────────────────────────────── */
.btn-login {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius-input);
  background: linear-gradient(130deg, #1e3a8a 0%, var(--primary) 50%, #3b82f6 100%);
  background-size: 200% 200%; background-position: 0% 50%;
  color: #ffffff; font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.02em; cursor: pointer; position: relative;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 14px rgba(29,78,216,0.3);
}
.btn-login:hover {
  background-position: 100% 50%; box-shadow: 0 6px 20px rgba(29,78,216,0.4);
  transform: translateY(-2px);
}
.btn-login:active { transform: translateY(0) scale(0.98); }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-inner { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-label { line-height: 1; }
.btn-arrow { flex-shrink: 0; transition: transform 0.2s; }
.btn-login:hover .btn-arrow { transform: translateX(4px); }
.btn-login.loading .btn-arrow { display: none; }

/* Spinner */
.btn-spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #ffffff; border-radius: 50%;
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
.btn-login.loading .btn-spinner { display: inline-block; }
.btn-login.loading { pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── 16. Card footer ──────────────────────────────────────────── */
.card-footer {
  margin-top: 26px; text-align: center; font-size: 0.75rem; color: #94a3b8;
  letter-spacing: 0.02em; animation: fadeUp 0.6s 0.35s var(--ease) both;
}

/* ── 17. Autofill override (Light Mode Fixed) ─────────────────── */
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 999px #e0e7ff inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

/* ── 18. Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 19. Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card { padding: 34px 24px 30px; border-radius: 20px; border-width: 0; box-shadow: none; background: transparent; }
  .page { background: #ffffff; padding: 0; }
  .grid-pattern, .orb { display: none; } /* Lebih ringan untuk HP */
}