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

:root {
  --blue: #0078D4;
  --blue-dark: #005a9e;
  --text: #1a1a2e;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --white: #ffffff;
  --red: #ef4444;
  --radius: 14px;
  --shadow: 0 24px 64px rgba(0,0,0,0.22), 0 4px 20px rgba(0,0,0,0.12);
}

/* ── Background ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f0f4f8;
}

/* ── Centered card ── */
.login-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.login-card {
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px;
  border: 1px solid rgba(0,120,212,0.08);
}

/* ── Brand ── */
.brand {
  text-align: center;
  margin-bottom: 32px;
}

.brand-logo {
  display: block;
  max-width: 200px;
  height: auto;
  margin: 0 auto 12px;
}

.brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ── Form ── */
.login-form { display: flex; flex-direction: column; gap: 20px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

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

.input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.input-wrap input {
  width: 100%;
  padding: 10px 40px 10px 38px;
  font-size: 0.9375rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,120,212,0.12);
}

.input-wrap input::placeholder { color: #b0bac4; }

.toggle-pw {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s;
}

.toggle-pw:hover { color: var(--blue); }
.toggle-pw .eye-icon { width: 16px; height: 16px; }

.error-msg {
  font-size: 0.8125rem;
  color: var(--red);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  display: none;
  animation: shake 0.3s ease;
}

.error-msg.visible { display: block; }

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

.btn-login {
  position: relative;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.btn-login:hover { background: var(--blue-dark); box-shadow: 0 4px 14px rgba(0,120,212,0.35); }
.btn-login:active { transform: scale(0.98); }
.btn-login:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-login.loading .btn-text { opacity: 0.5; }
.btn-login.loading .btn-spinner { display: block; }

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

/* ── Footer ── */
.footer-note {
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .login-card { padding: 36px 24px; }
}
