/* ============================================================
   Auth pages (login / register / forgot / reset)
   Standalone layout - same palette as app.css, but centered card
   instead of the sidebar shell.
   ============================================================ */

/* The attribute wins, everywhere. The browser's own [hidden] rule has zero specificity, so any
   class that sets display would outrank it and keep a hidden panel on screen. */
[hidden] { display: none !important; }

:root {
  --canvas: #F7F5F2;
  --surface: #FFFFFF;
  --border: #E2DDD6;
  --text-primary: #1C1A17;
  --text-secondary: #6B6459;
  --text-muted: #9B9189;
  --brand: #8B6F47;
  --brand-dark: #5C4730;
  --brand-bg: #F5EFE6;
  --ok: #4A7C59;
  --ok-bg: #EBF5EF;
  --err: #C0392B;
  --err-bg: #FBEEEC;
}

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

body {
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--canvas);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-brand .mark {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; font-weight: 600;
}
.auth-brand .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 600;
}

.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 22px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
}
.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-bg);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.auth-links {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.auth-links a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }
.auth-links .sep { margin: 0 8px; color: var(--border); }

/* Alerts - shape expected by showAlert()/clearAlert() in api-config.js */
.alert {
  display: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert.show { display: block; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: #EDCFCA; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #CFE5D6; }

/* Button spinner - shape expected by setButtonLoading() */
.loading {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: authspin 0.7s linear infinite;
}
@keyframes authspin { to { transform: rotate(360deg); } }
