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

:root {
  --primary: #2563EB;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --error: #ef4444;
  --success: #22c55e;
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
  --radius: 12px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

/* ========================
   PAGE WRAPPER
======================== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

/* ========================
   BACKGROUND DECORATION
======================== */
.bg-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  animation: float 8s ease-in-out infinite;
}

.circle-1 { width: 400px; height: 400px; top: -100px; right: -100px; animation-delay: 0s; }
.circle-2 { width: 300px; height: 300px; bottom: -80px; left: -80px; animation-delay: 3s; }
.circle-3 { width: 200px; height: 200px; top: 50%; left: 10%; animation-delay: 6s; background: rgba(37,99,235,0.07); }

@keyframes float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* ========================
   LOGIN CONTAINER
======================== */
.login-container {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
  animation: slideUp 0.5s ease-out;
}

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

/* ========================
   HEADER
======================== */
.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.logo { display: inline-block; margin-bottom: 20px; }

.logo svg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.login-header h1 { font-size: 26px; font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.login-header p { color: var(--text-muted); font-size: 15px; }

/* ========================
   ALERT
======================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  font-weight: 500;
}

.alert.hidden { display: none; }
.alert.error { background: #fef2f2; border: 1px solid #fecaca; color: var(--error); }
.alert.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); }

/* ========================
   FORM GROUPS
======================== */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-wrapper input.error { border-color: var(--error); }
.input-wrapper input::placeholder { color: #94a3b8; }

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0;
  transition: color var(--transition);
}

.toggle-password:hover { color: var(--primary); }

.field-error {
  display: block;
  font-size: 13px;
  color: var(--error);
  margin-top: 5px;
  min-height: 18px;
}

/* ========================
   FORM OPTIONS
======================== */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  user-select: none;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkmark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.checkbox-label input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

.forgot-link {
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.forgot-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ========================
   BUTTON
======================== */
.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-login:active { transform: translateY(0); }

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========================
   SPINNER
======================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner.hidden { display: none; }

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

/* ========================
   FOOTER
======================== */
.login-footer {
  margin-top: 32px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.login-footer p { font-size: 12px; color: var(--text-muted); }

/* ========================
   RESPONSIVE
======================== */
@media (max-width: 480px) {
  .login-container { padding: 36px 24px; }
  .login-header h1 { font-size: 22px; }
}
