:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #2871bf;
  --accent-hover: #034be6;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --shadow-card:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-wrapper {
  display: flex;
  width: min(100%, 1100px);
  min-height: min(80vh, 640px);
  background: #fff;
  border-radius: clamp(14px, 2vw, 20px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.illustration-logo {
  width: min(100%, 120px);
  height: auto;
  margin-bottom: 1rem;
}

/* Illustration Side */
.login-illustration {
  flex: 0 0 46%;
  background: linear-gradient(160deg, #062782 0%, #3084ab 50%, #17334d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  position: relative;
  overflow: hidden;
}

.login-illustration::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 70%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 50%
    );
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-20px, -20px);
  }
}

.illustration-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 380px;
}

.illustration-content h5 {
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.illustration-content h4 {
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.illustration-content p {
  color: rgba(255, 255, 255, 0.737);
  font-size: 0.75rem;
  line-height: 1.6;
  margin-bottom: 40px;
}

.illustration-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* Form Side */
.login-form-side {
  flex: 1;
  padding: clamp(24px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.form-header {
  margin-bottom: 40px;
}

.form-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  display: block;
}

.input-wrapper {
  position: relative;
}

.form-control {
  height: 52px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 16px 0 48px;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--primary);
  background: #fff;
  transition: all 0.2s ease;
  width: 100%;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent);
}

.form-control.is-invalid + .input-icon,
.input-wrapper.is-invalid .input-icon {
  color: #ef4444;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--primary);
}

.invalid-feedback {
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-login {
  width: 100%;
  height: 52px;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-hover) 100%
  );
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  letter-spacing: 0.01em;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-login.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

.signup-text {
  text-align: center;
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.signup-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.signup-text a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Floating shapes */
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: #6366f1;
  top: -80px;
  right: -80px;
}
.shape-2 {
  width: 200px;
  height: 200px;
  background: #8b5cf6;
  bottom: -60px;
  left: -60px;
}
.shape-3 {
  width: 120px;
  height: 120px;
  background: #ec4899;
  top: 40%;
  left: 10%;
}

/* Responsive */
@media (max-width: 991px) {
  body {
    padding: 16px;
    align-items: stretch;
  }

  .login-wrapper {
    flex-direction: column;
    width: 100%;
    min-height: auto;
  }

  .login-illustration {
    padding: 32px 24px;
    min-height: 260px;
  }

  .illustration-content h4 {
    font-size: 1.35rem;
  }
  .illustration-svg {
    max-width: 240px;
  }
  .login-form-side {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .login-wrapper {
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .login-form-side {
    padding: 24px 20px 28px;
  }

  .login-illustration {
    padding: 24px 20px 20px;
    min-height: 220px;
  }

  .form-header {
    margin-bottom: 24px;
  }

  .form-header h1 {
    font-size: 1.5rem;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-control {
    height: 48px;
  }

  .btn-login {
    height: 48px;
  }
}
