/* Auth pages — matches Manufacturing / HR design */

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-input: #cbd5e1;
  --blue: #4f46e5;
  --blue-2: #4338ca;
  --blue-soft: #eef2ff;
  --green: #059669;
  --red: #dc2626;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.auth-app {
  min-height: 100dvh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 120px);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-shell {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem 1.75rem;
  animation: authCardIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.auth-brand {
  margin-bottom: 1.5rem;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-sub {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.auth-input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.92rem;
  background: var(--surface-soft);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.auth-btn {
  position: relative;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.72rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.auth-btn:hover:not(:disabled) {
  background: var(--blue-2);
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #ffffff;
  transform: translateY(-50%);
  animation: authSpin 0.6s linear infinite;
}

@keyframes authSpin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.auth-msg {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--red);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.auth-msg.show {
  opacity: 1;
}

.auth-msg.ok {
  color: var(--green);
}

.auth-msg.shake {
  animation: authShake 0.25s;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.auth-link {
  font-size: 0.88rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  text-align: center;
}

.auth-link:hover {
  color: var(--blue-2);
  text-decoration: underline;
}

.auth-note {
  margin: -0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: left;
}
