/* The sign-in and set-password pages, and nothing else.

   These two pages are the only part of the site a signed-out visitor can load,
   so they get their own small stylesheet instead of styles.css. That keeps the
   dashboard's full design -- every page, chart and component -- behind the
   login, rather than public because a login form needed a dozen of its rules.

   Values are copied from styles.css so both pages look exactly as they did.
   Neither page ever turns dark, so there is deliberately no dark block here:
   Classic leaves data-theme off them, and the light-only themes in skins/
   set it to light. If you restyle the login form, change it in BOTH files. */

:root {
  color-scheme: light;
  --page: #fbf6f7;
  --surface-1: #ffffff;
  --text-primary: #1d2025;
  --text-secondary: #5b5d66;
  /* Mirrors styles.css: #9a9ba3 was 2.77:1, and on these two pages it
     carries the only status line a signed-out visitor gets. */
  --text-muted: #6d6d73;
  --border: #ece3e5;
  /* Mirrors styles.css --control-border: the edge of a field, which --border
     draws at 1.26:1 -- and on these two pages the fields are the whole page
     (audit #28). 3.40 on the card, 3.18 on the fill inside it. */
  --control-border: #8f8a8b;
  --brand-accent: #f87291;
  /* The pink is a fill; white on it was 2.69:1 on the Sign in and Set
     password buttons. Near-black on it is 7.13. */
  --brand-accent-ink: #1a0a10;
  --brand-accent-text: #a94e63;
  --critical: #dc2626;
  --critical-text: #c03025;
  /* The dashboard's focus ring (styles.css): near-black, clear on white and
     on the pink button. */
  --focus: #1d2025;
}

/* The two global rules from styles.css that reach these pages. Without the
   first, padding stops counting inside declared widths and the card renders
   374px wide instead of 320 -- which a side-by-side measurement caught. */
* { box-sizing: border-box; }
a { color: inherit; }

/* A form control does not inherit the page's font on its own, so the two
   fields and the button on the sign-in card rendered in Arial beside Assistant
   headings -- on the first page of the product, and nowhere else in it
   (audit #60). */
input, button { font: inherit; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: "Assistant", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page);
}

.login-card {
  /* Was a flat 320px, which at a 320px window left the card touching both
     edges (audit #60). It keeps the width it had and gives up 16px a side
     when there is not room for it. */
  width: min(320px, 100% - 32px);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 26px;
  border-top: 3px solid var(--brand-accent);
}

.login-card h1 {
  font-size: 18px;
  margin: 0 0 4px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  /* 16px, not 14: iOS zooms the page in on a focused field set smaller than
     16px, and the first thing this product does on a phone should not be to
     jump. The padding brings the box to the 44px a finger wants (#60). */
  padding: 11px 12px;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid var(--control-border);
  background: var(--page);
  color: var(--text-primary);
  font-size: 16px;
}

.login-card button {
  width: 100%;
  padding: 12px;
  min-height: 44px;
  border-radius: 6px;
  border: none;
  background: var(--brand-accent);
  color: var(--brand-accent-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

.login-card button:disabled { opacity: 0.6; cursor: default; }

/* Always in the page, empty until there is something to say. It used to be
   display:none, and set-password never turned it on, so nobody there ever
   saw an error. Kept rendered (not hidden while empty) because a screen
   reader only listens to a live region that is already in the page. */
.error {
  color: var(--critical-text);
  font-size: 13px;
  margin-top: 12px;
}
.error:empty { margin-top: 0; }

.field input[aria-invalid="true"] { border-color: var(--critical); }

/* The rule, said before anyone trips over it rather than after. */
.login-card .field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* "Forgot your password?" is a button that looks like the link it was. The
   -1px lets its underline hang below the line, as the link's did, rather
   than making the row a pixel taller. */
.login-card .link-btn {
  width: auto;
  margin: 0 0 -1px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.login-card .link-btn:hover { color: var(--brand-accent-text); border-bottom-color: var(--brand-accent); }

.login-alt {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
}

.login-alt a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.login-alt a:hover { color: var(--brand-accent-text); border-bottom-color: var(--brand-accent); }

/* The one line on either page that prints back what was typed: "If <address>
   has an account...". An email address breaks at its dots, hyphens and @, so
   the real ones wrap on their own -- break-word is only the floor under an
   address that has none, and changes nothing about where the rest breaks. */
.login-note {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
  overflow-wrap: break-word;
}
