/* ============================================================
   /login/ — Calm-Workspace login form
   TASK-229 / GOAL-finalization L1

   One accent (--blue) on a monochrome pale surface. All values
   reference design tokens — no hardcoded hex/px for color, font,
   radius, or shadow. Tap targets ≥ 44px, visible focus ring,
   prefers-reduced-motion honoured.
   ============================================================ */

.sf-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background: var(--page);
  font-family: var(--font);
  color: var(--ink);
}

.sf-login__card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 480px) {
  .sf-login { padding: 16px 12px; }
  .sf-login__card { padding: 28px 22px; }
}

/* --- Brand wordmark ----------------------------------------- */
.sf-login__brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  text-decoration: none;
  color: inherit;
  margin-bottom: 4px;
}

.sf-login__brandmark {
  display: block;
  width: auto;
  height: 34px;
}

.sf-login__brand:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 4px;
}

/* --- Headline + subhead ------------------------------------ */
.sf-login__title {
  margin: 0;
  font: 800 26px/1.2 var(--font);
  color: var(--ink);
  letter-spacing: -0.01em;
}

.sf-login__subtitle {
  margin: -16px 0 0;
  font: 400 14px/1.5 var(--font);
  color: var(--muted);
}

/* --- Error alert (enumeration-safe single message) --------- */
.sf-login__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--red-fill);
  border: 1px solid var(--red-cat);
  border-radius: var(--r-card-sm);
  color: var(--red-ink);
  font: 600 14px/1.4 var(--font);
}

.sf-login__alert svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--red-ink);
  margin-top: 1px;
}

.sf-login__alert p {
  margin: 0;
}

/* --- Form layout -------------------------------------------- */
.sf-login__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sf-login__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sf-login__label {
  font: 700 13px/1.3 var(--font);
  color: var(--ink);
}

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

.sf-login__input-wrap svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  pointer-events: none;
  transition: color .15s;
}

.sf-login__input {
  width: 100%;
  min-height: 48px;            /* ≥ 44px tap target */
  padding: 12px 14px 12px 42px; /* room for the leading icon */
  border: 1px solid var(--input-border);
  border-radius: var(--r-btn);
  background: var(--white);
  font: 500 15px/1.3 var(--font);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.sf-login__input::placeholder {
  color: var(--muted-2);
}

.sf-login__input:hover {
  border-color: var(--blue);
}

.sf-login__input:focus,
.sf-login__input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-fill);
}

.sf-login__input-wrap:focus-within svg {
  color: var(--blue);
}

/* --- Remember + forgot row --------------------------------- */
.sf-login__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
  flex-wrap: wrap;
}

.sf-login__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font: 500 14px/1.2 var(--font);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.sf-login__remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.sf-login__forgot {
  font: 600 14px/1.2 var(--font);
  color: var(--deep-blue);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.sf-login__forgot:hover,
.sf-login__forgot:focus-visible {
  color: var(--blue-hover);
  text-decoration: underline;
}

.sf-login__forgot:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Submit button (overrides .btn-primary for full-width) - */
.sf-login__submit {
  width: 100%;
  min-height: 52px;            /* generous primary CTA */
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.sf-login__submit:focus-visible {
  outline: 3px solid var(--blue-fill);
  outline-offset: 2px;
}

/* --- Footnote (browse hint) -------------------------------- */
.sf-login__footnote {
  margin: 0;
  text-align: center;
  font: 500 14px/1.5 var(--font);
  color: var(--muted);
}

.sf-login__footnote a {
  color: var(--deep-blue);
  font-weight: 700;
  text-decoration: none;
}

.sf-login__footnote a:hover,
.sf-login__footnote a:focus-visible {
  color: var(--blue-hover);
  text-decoration: underline;
}

.sf-login__footnote a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sf-login__input,
  .sf-login__input-wrap svg,
  .sf-login__submit {
    transition: none;
  }
}

/* ============================================================
   /login/ — shared surface additions for the password-reset
   family (TASK-298).

   Adds four small blocks used by page-login.php's success notice
   and by page-lost-password.php / page-reset-password.php:
     - .sf-login__notice[--success]   success-state banner
                                     (positive, not an error)
     - .sf-login__icon[--warn]       big centered glyph above the
                                     headline on sent/expired states
     - .sf-login__back               back-link row under the form
     - .sf-login__hint               small helper text on the
                                     confirmation state

   All values are tokens (no hex/px hardcodes). Amber for the
   warning/expired surface — per the Calm-Workspace semantic
   palette ("pending/flagged/expired" = amber, NOT red).
   ============================================================ */

.sf-login__notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--green-fill);
  border: 1px solid var(--green);
  border-radius: var(--r-card-sm);
  color: var(--green-ink);
  font: 600 14px/1.4 var(--font);
}

.sf-login__notice--success {
  /* Same as base — explicitly named so future variants (--info, --warn)
     can override the fill/border without touching the .sf-login__notice
     base shared with the .sf-login__alert family. */
  background: var(--green-fill);
  border-color: var(--green);
  color: var(--green-ink);
}

.sf-login__notice svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--green-ink);
  margin-top: 1px;
}

.sf-login__notice p {
  margin: 0;
}

.sf-login__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--blue-fill);
  color: var(--blue);
  align-self: center;
  margin: 0 auto;
}

.sf-login__icon svg {
  width: 28px;
  height: 28px;
}

.sf-login__icon--warn {
  background: var(--amber-fill);
  color: var(--amber-text);
}

.sf-login__hint {
  margin: 0;
  text-align: center;
  font: 400 13px/1.5 var(--font);
  color: var(--muted);
}

.sf-login__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  min-height: 44px;
  font: 600 14px/1.2 var(--font);
  color: var(--deep-blue);
  text-decoration: none;
  padding: 8px 12px;
}

.sf-login__back svg {
  width: 18px;
  height: 18px;
}

.sf-login__back:hover,
.sf-login__back:focus-visible {
  color: var(--blue-hover);
  text-decoration: underline;
}

.sf-login__back:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Honeypot (register form) --------------------------------
   Off-screen positioning, not display:none — some bots skip
   display:none fields, so this stays in the accessibility tree
   dimensionally but out of the visible viewport. Same recipe as
   .sf-brochure-modal__hp (assets/css/pages/programs.css). */
.sf-login__honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

