/*
 * login.css — Login + change-password page styles
 * Requires: theme.css
 */

/* ── Page layout (centered card) ───────────────────────── */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Card ───────────────────────────────────────────────── */
.card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* ── Card header (uses .gradient-header from theme.css) ── */
.card-header {
  padding: 32px 36px 28px;
}
.title-row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
}
.card-header h1 {
  font-size: 1.5rem; font-weight: 600; color: #0f172a;
  letter-spacing: -0.02em;
}
.card-header .subtitle {
  margin-top: 8px;
}

/* Dot colours */
/* .dot is defined in theme.css (green, pulsing) — do not redefine here */
/* .dot-warn overrides colour only; pulse animation is inherited from theme */
.dot-warn { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

/* ── Card body ──────────────────────────────────────────── */
.card-body { padding: 28px 36px 32px; }

/* ── Inline error message ───────────────────────────────── */
.error-msg {
  display: none;
  align-items: center; gap: 8px;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.88rem; color: #b91c1c;
}
.error-msg.show { display: flex; }

/* ── Form fields ────────────────────────────────────────── */
.field       { margin-bottom: 16px; }
label {
  display: block;
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-dim); margin-bottom: 7px;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.input-wrap  { position: relative; }
.input-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.95rem;
  pointer-events: none; user-select: none;
  font-family: var(--font-mono);
}
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px 38px 10px 36px; /* right padding for eye button */
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem; font-family: var(--font-sans);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  background: var(--surface);
}
input::placeholder { color: var(--text-muted); font-size: 0.9rem; }

/* ── Eye toggle button ──────────────────────────────────── */
.eye-btn {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; padding: 4px;
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  opacity: 0.55;
  transition: opacity .15s, color .15s;
  line-height: 0;
}
.eye-btn:hover  { opacity: 1; color: var(--text); }
.eye-btn:active { transform: translateY(-50%) scale(0.9); }
.eye-btn svg    { width: 18px; height: 18px; display: block; }

/* ── Sign In / Set Password button ─────────────────────── */
.btn-signin {
  width: 100%; margin-top: 8px;
  padding: 11px 18px;
  background: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  color: #fff; font-size: 0.9rem; font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}
.btn-signin:hover:not(:disabled) {
  background: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12), 0 2px 6px rgba(37,99,235,0.2);
}
.btn-signin:active:not(:disabled) { transform: translateY(1px); }
.btn-signin:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-signin .spinner {
  display: none;
  width: 16px; height: 16px;
  border-color: rgba(255,255,255,0.35);
  border-top-color: #fff;
}
.btn-signin.loading .spinner { display: block; }
.btn-signin.loading .label   { opacity: 0.7; }

/* ── Password strength bar ──────────────────────────────── */
.strength-bar {
  margin-top: 8px;
  height: 4px; border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.strength-fill {
  height: 100%; width: 0;
  border-radius: 2px;
  transition: width .3s ease, background-color .3s ease;
}
.strength-fill.weak   { background: #ef4444; }
.strength-fill.fair   { background: #f59e0b; }
.strength-fill.strong { background: #22c55e; }

/* ── Strength rule checklist ────────────────────────────── */
.strength-rules {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.rule {
  font-size: 0.78rem; font-family: var(--font-mono);
  color: var(--text-muted);
  transition: color .2s;
}
.rule::before { content: '○  '; }
.rule.pass { color: #16a34a; }
.rule.pass::before { content: '✓  '; }
.rule.fail { color: #dc2626; }
.rule.fail::before { content: '✗  '; }

/* ── Confirm-password match hint ────────────────────────── */
.match-hint {
  margin-top: 6px;
  font-size: 0.78rem; font-family: var(--font-mono);
  min-height: 1em;
  transition: color .2s;
}
.match-ok   { color: #16a34a; }
.match-fail { color: #dc2626; }

/* ── Footer note ────────────────────────────────────────── */
.note {
  margin-top: 18px; text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--text-muted);
}
.note span { color: var(--accent); }
