/* ============================================================
   MACHINESENS — LOGIN
   login.css — Authentication page only
   ============================================================ */

.login-page {
  overflow: hidden;
  background: var(--bg-base);
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr 440px;
  height: 100vh;
}

/* ── Left Panel ──────────────────────────────────────────────── */
.login-left {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow */
.login-left::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 106, 247, 0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.login-brand-mark {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-primary), #a78bf6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(124, 106, 247, 0.25);
}

.login-brand-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.login-brand-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  max-width: 240px;
  line-height: 1.6;
}

/* ── Right Panel ─────────────────────────────────────────────── */
.login-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 48px;
  gap: 0;
}

.login-heading {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13.5px;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

/* ── Form Elements ───────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-input::placeholder { color: var(--text-disabled); }

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-bg);
}

.field-error {
  font-size: 12px;
  color: var(--red);
  display: none;
}

.field-error.show { display: block; }

.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: color 0.12s;
  display: flex;
  align-items: center;
}

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

/* ── Login Button ────────────────────────────────────────────── */
.login-btn {
  width: 100%;
  height: 40px;
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.15s;
}

.login-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-btn .spinner {
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
  width: 14px;
  height: 14px;
}

/* ── Error Alert ─────────────────────────────────────────────── */
.login-alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.login-alert.show { display: block; }

.login-alert.error   { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.login-alert.success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }

/* ── Footer ──────────────────────────────────────────────────── */
.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-disabled);
  text-align: center;
}

@media (max-width: 768px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-left  { display: none; }
  .login-right { padding: 32px 24px; }
}
