:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #0ea5e9;
  --success: #10b981;
  --danger: #ef4444;
  --bg-gradient-start: #1e3a8a;
  --bg-gradient-end: #0369a1;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 20px);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Animated background particles */
body::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Floating shapes in background */
body::after {
  content: '';
  position: absolute;
  width: min(300px, 40vw);
  height: min(300px, 40vw);
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  top: -150px;
  right: -150px;
  animation: floatShape 15s ease-in-out infinite;
}

@keyframes floatShape {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 50px) scale(1.1); }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(440px, 95vw);
  animation: slideUp 0.6s ease-out;
}

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

.login-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: clamp(16px, 4vw, 24px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: clamp(24px, 6vw, 48px) clamp(20px, 5vw, 40px);
  position: relative;
  overflow: hidden;
}

/* Decorative gradient border effect */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(3px, 0.5vw, 4px);
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: clamp(16px, 4vw, 24px) clamp(16px, 4vw, 24px) 0 0;
}

.logo-section {
  text-align: center;
  margin-bottom: clamp(20px, 5vw, 32px);
}

.logo-icon {
  width: clamp(60px, 15vw, 80px);
  height: clamp(60px, 15vw, 80px);
  border-radius: clamp(14px, 3.5vw, 20px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(10px, 2.5vw, 16px);
  box-shadow: 0 8px 20px rgba(232, 235, 37, 0.3);
  animation: pulse 2.5s ease-in-out infinite;
  position: relative;
  padding: clamp(6px, 1.5vw, 10px);
}

/* Glow effect */
.logo-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: clamp(16px, 4vw, 22px);
  opacity: 0.15;
  filter: blur(12px);
  z-index: -1;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-card h1 {
  font-family: 'Poppins', 'Signika', 'Segoe UI', sans-serif;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 700;
  color: #1e293b;
  margin-bottom: clamp(4px, 1vw, 6px);
  letter-spacing: -0.5px;
}

.subtitle {
  color: #64748b;
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 500;
  margin-bottom: 0;
}

.flash {
  padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 18px);
  border-radius: clamp(10px, 2vw, 12px);
  margin-bottom: clamp(18px, 4vw, 28px);
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  animation: shake 0.5s ease, fadeIn 0.3s ease;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  border-left: clamp(3px, 0.5vw, 4px) solid #dc2626;
  box-shadow: var(--shadow-sm);
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 500;
}

.flash-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
  border-left-color: #059669;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.flash i {
  font-size: clamp(16px, 3.5vw, 20px);
  flex-shrink: 0;
}

.form-group {
  margin-bottom: clamp(16px, 4vw, 24px);
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: clamp(6px, 1.5vw, 10px);
  color: #334155;
  font-weight: 600;
  font-size: clamp(12px, 2.5vw, 14px);
  letter-spacing: 0.2px;
}

.input-group-custom {
  position: relative;
}

.input-icon {
  position: absolute;
  left: clamp(14px, 3vw, 18px);
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: clamp(16px, 3.5vw, 18px);
  z-index: 2;
  transition: all 0.3s ease;
}

.form-control {
  width: 100%;
  padding: clamp(12px, 3vw, 15px) clamp(14px, 3vw, 18px) clamp(12px, 3vw, 15px) clamp(42px, 10vw, 50px);
  border: 2px solid #e2e8f0;
  border-radius: clamp(10px, 2.5vw, 14px);
  font-size: clamp(13px, 3vw, 15px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8fafc;
  color: #1e293b;
  font-weight: 500;
}

.form-control::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.form-control:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.form-control:focus + .input-icon {
  color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.password-toggle {
  position: absolute;
  right: clamp(14px, 3vw, 18px);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: clamp(4px, 1vw, 6px);
  z-index: 2;
  transition: all 0.3s ease;
  border-radius: clamp(6px, 1.5vw, 8px);
}

.password-toggle:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

/* Forgot Password Link */
.forgot-password-link {
  text-align: right;
  margin-top: clamp(-8px, -2vw, -12px);
  margin-bottom: clamp(12px, 3vw, 20px);
}

.forgot-password-link a {
  color: var(--primary);
  text-decoration: none;
  font-size: clamp(12px, 2.5vw, 13px);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: clamp(4px, 1vw, 6px);
  transition: all 0.3s ease;
  padding: clamp(4px, 1vw, 6px) clamp(6px, 1.5vw, 8px);
  border-radius: clamp(6px, 1.5vw, 8px);
}

.forgot-password-link a:hover {
  color: var(--primary-dark);
  background: rgba(37, 99, 235, 0.1);
  transform: translateX(-2px);
}

.forgot-password-link a i {
  font-size: clamp(11px, 2.5vw, 12px);
}

/* Back Link */
.back-link {
  margin-bottom: clamp(16px, 4vw, 24px);
}

.back-link a {
  color: #64748b;
  text-decoration: none;
  font-size: clamp(13px, 3vw, 14px);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 8px);
  transition: all 0.3s ease;
  padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2.5vw, 12px);
  border-radius: clamp(8px, 2vw, 10px);
}

.back-link a:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  transform: translateX(-4px);
}

.back-link a i {
  font-size: clamp(13px, 3vw, 14px);
}

/* Password Strength Indicator */
.password-strength {
  display: none;
  margin-bottom: clamp(12px, 3vw, 16px);
  padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 14px);
  background: #f8fafc;
  border-radius: clamp(8px, 2vw, 10px);
  border-left: clamp(3px, 0.5vw, 4px) solid #94a3b8;
}

.btn-login {
  width: 100%;
  padding: clamp(13px, 3vw, 16px);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: clamp(10px, 2.5vw, 14px);
  font-size: clamp(14px, 3vw, 16px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  margin-top: clamp(8px, 2vw, 12px);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

/* Button shine effect */
.btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-login i {
  margin-left: clamp(6px, 1.5vw, 8px);
  transition: transform 0.3s ease;
}

.btn-login:hover i {
  transform: translateX(4px);
}

.footer-text {
  text-align: center;
  margin-top: clamp(18px, 4vw, 28px);
  color: #64748b;
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 6px);
}

.footer-text i {
  color: var(--primary);
}

/* Loading state for button */
.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Media queries untuk fine-tuning jika diperlukan */
@media (max-width: 360px) {
  .login-card {
    padding: 20px 16px;
  }
}

@media (min-width: 768px) {
  .form-control:focus {
    transform: translateY(-2px);
  }
}