/* MoveHappy Office — the sign-in family: login, my account, password help and sign out, drawn through
   auth/view.php before authentication with no Bootstrap and no shell. It keeps its own small sheet
   (form-uniformity design, exception 1): office-tokens.css is linked first and this sheet restates the
   office form recipe in those tokens: fields as .form-control.input-sm, the button as .btn-primary, the
   notice as the .mh-status inset, labels and hints as the shared label and help text. No literal colour
   lives here; every colour, font, radius, distance and shadow is a token. */

* { box-sizing: border-box; }

/* The canvas and the page's type. */
html {
  font-family: var(--mh-font);
  font-size: var(--mh-text);
  line-height: var(--mh-leading);
  color: var(--mh-ink-body);
  background: var(--mh-canvas) var(--mh-texture-grain);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { margin: 0; padding: var(--mh-space-8) var(--mh-space-6); }
main { max-width: var(--mh-content-max); margin: auto; }

/* The header: the wordmark and the account links, in the chrome blue over a hairline. */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--mh-space-4);
  padding: var(--mh-space-2) 0 var(--mh-space-5);
  border-bottom: 1px solid var(--mh-line);
}

header > a, header > .wordmark { font-size: var(--mh-text-xl); font-weight: 700; letter-spacing: var(--mh-tracking-tight); }
header > .wordmark { color: var(--mh-blue); }
nav { display: flex; gap: var(--mh-space-4); font-size: var(--mh-text-nav); font-weight: 700; }
a { color: var(--mh-blue); text-decoration: none; }
a:hover { color: var(--mh-blue-deep); text-decoration: underline; }

h1 { margin: var(--mh-space-6) 0 var(--mh-space-4); font-size: var(--mh-text-2xl); font-weight: 700; line-height: var(--mh-leading-tight); letter-spacing: var(--mh-tracking-tight); color: var(--mh-ink); }
h2 { margin: 0 0 var(--mh-space-3); font-size: var(--mh-text-xl); font-weight: 700; line-height: var(--mh-leading-tight); color: var(--mh-ink); }
strong { color: var(--mh-ink); }

/* Cards: a form or a .card is a sheet of paper on the canvas; the account form is a narrow one, centred. */
form, .card {
  margin: var(--mh-space-5) 0;
  padding: var(--mh-space-6);
  background: var(--mh-paper);
  border: 1px solid var(--mh-line);
  border-radius: var(--mh-radius-xl);
  box-shadow: var(--mh-shadow-sm);
}

form.account, .card.account { max-width: calc(var(--mh-field-wide) + 2 * var(--mh-space-6)); margin: var(--mh-space-8) auto; }
/* The page title (and the office it belongs to) sits over the centred account form, in its width, rather than at the
   far left of the page. */
main:has(> .account) > h1, main:has(> .account) > .who { max-width: calc(var(--mh-field-wide) + 2 * var(--mh-space-6)); margin-left: auto; margin-right: auto; }
main:has(> .account) > h1 + .account, main:has(> .account) > .who + .account { margin-top: var(--mh-space-3); }
main:has(> .account) > h1:has(+ .who) { margin-bottom: var(--mh-space-1); }
.who { margin-top: 0; margin-bottom: 0; font-size: var(--mh-text-nav); color: var(--mh-ink-muted); }

/* The register page's connection: its address large between hairlines, under a small name. */
.address { display: block; margin: 0 0 var(--mh-space-4); padding: var(--mh-space-3) 0; font-size: var(--mh-text-small); color: var(--mh-ink-muted); border-top: 1px solid var(--mh-line-soft); border-bottom: 1px solid var(--mh-line-soft); }
/* At the top of its card the card's own edge is the line above it. */
.account > .address:first-child, .account > input[type="hidden"]:first-child + .address { padding-top: 0; border-top: 0; }
.address strong { display: block; margin-top: 2px; font-size: var(--mh-text-xl); color: var(--mh-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lead { margin: 0; }
label .optional { margin-left: var(--mh-space-2); font-weight: 400; color: var(--mh-ink-muted); }
/* A link that does what a button does (Sign in, once registered) looks like the button. */
a.button { display: inline-block; margin-top: var(--mh-space-4); padding: 8px 14px; font-weight: 700; line-height: 18px; color: var(--mh-on-accent); background-color: var(--mh-blue); background-image: var(--mh-texture-stone-fill), var(--mh-sheen-stone); border: 1px solid var(--mh-blue-deep); border-radius: var(--mh-radius); box-shadow: var(--mh-bevel-lit), 0 var(--mh-ledge) 0 var(--mh-blue-ledge), var(--mh-shadow-lift); }
a.button:hover { color: var(--mh-on-accent); text-decoration: none; filter: brightness(1.025); }
form > :first-child, form > input[type="hidden"]:first-child + * { margin-top: 0; }

/* Labels: small, bold, the body ink; 16px opens each row and 4px sits under the label. */
label {
  display: block;
  margin: var(--mh-space-4) 0 var(--mh-space-1);
  font-size: var(--mh-text-nav);
  font-weight: 700;
  line-height: 18px;
  color: var(--mh-ink-body);
}

/* Fields: the base sheet's .form-control.input-sm, pressed slightly into the sheet. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  display: block;
  width: 100%;
  height: var(--mh-control-sm);
  margin: 0;
  padding: 4px 10px;
  font-family: var(--mh-font);
  font-size: 13px;
  font-weight: 400;
  line-height: var(--mh-leading);
  color: var(--mh-ink);
  background-color: var(--mh-paper);
  border: 1px solid var(--mh-line-input);
  border-radius: var(--mh-radius-sm);
  box-shadow: var(--mh-shadow-field);
  transition: border-color var(--mh-fast), box-shadow var(--mh-fast);
}

textarea { height: auto; min-height: 72px; padding: 6px 10px; resize: vertical; }

/* Selects carry the chevron; a list box keeps its native rows. */
select:not([multiple]):not([size]) {
  padding-right: 28px;
  background-image: var(--mh-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  -webkit-appearance: none;
  appearance: none;
}

select[multiple], select[size] { height: auto; min-height: 120px; padding: var(--mh-space-1); }

input:focus, select:focus, textarea:focus { border-color: var(--mh-blue); outline: none; box-shadow: var(--mh-shadow-field), var(--mh-focus); }
input::placeholder, textarea::placeholder { color: var(--mh-ink-faint); }
input[disabled], input[readonly], select[disabled], textarea[disabled], textarea[readonly] { color: var(--mh-ink-muted); background-color: var(--mh-subtle); box-shadow: none; cursor: default; }
input[type="checkbox"], input[type="radio"] { width: var(--mh-check); height: var(--mh-check); margin: 0 var(--mh-space-2) 0 0; vertical-align: middle; accent-color: var(--mh-blue); }

/* The button: the base sheet's .btn-primary, a stone wafer standing on a ledge in the deep blue. */
button {
  display: inline-block;
  min-width: 88px;
  min-height: var(--mh-control-sm);
  margin: var(--mh-space-4) 0 0;
  padding: 8px 14px;
  font-family: var(--mh-font);
  font-size: var(--mh-text);
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.01em;
  color: var(--mh-on-accent);
  background-color: var(--mh-blue);
  background-image: var(--mh-texture-stone-fill), var(--mh-sheen-stone);
  border: 1px solid var(--mh-blue-deep);
  border-radius: var(--mh-radius);
  box-shadow: var(--mh-bevel-lit), 0 var(--mh-ledge) 0 var(--mh-blue-ledge), var(--mh-shadow-lift);
  cursor: pointer;
  transition: box-shadow var(--mh-rise) var(--mh-ease-rise), transform var(--mh-rise) var(--mh-ease-rise), filter var(--mh-rise) var(--mh-ease-rise);
}

button:hover { transform: translateY(-2px); filter: brightness(1.025); box-shadow: var(--mh-bevel-lit), 0 var(--mh-ledge) 0 var(--mh-blue-ledge), var(--mh-shadow-lift-hover); }
button:active { background-color: var(--mh-blue-deep); background-image: var(--mh-texture-stone); box-shadow: var(--mh-shadow-press); transform: translateY(1px); filter: brightness(0.97); transition-duration: var(--mh-fast); }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--mh-blue); outline-offset: 2px; }
button[disabled] { background-image: none; box-shadow: none; transform: none; filter: none; opacity: 0.55; cursor: default; }

/* The notice: the status inset, grey; .error turns it signal. */
.notice {
  margin: var(--mh-space-3) 0;
  padding: var(--mh-space-2) var(--mh-space-3);
  font-size: var(--mh-text-small);
  line-height: 16px;
  color: var(--mh-ink-muted);
  white-space: pre-line;
  background: var(--mh-subtle);
  border: 1px solid var(--mh-line);
  border-radius: var(--mh-radius);
  box-shadow: var(--mh-shadow-pit);
}

.notice.error { color: var(--mh-signal-deep); background: var(--mh-signal-soft); border-color: var(--mh-signal-line); }

/* Help text. */
.hint { margin: var(--mh-space-3) 0 0; font-size: var(--mh-text-small); line-height: 16px; color: var(--mh-ink-muted); }

/* Tables: soft row lines, a light head in small capitals. */
table { width: 100%; margin: var(--mh-space-4) 0; border-collapse: collapse; background: var(--mh-paper); }
th, td { padding: var(--mh-space-3) var(--mh-space-4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--mh-line-soft); }
th { font-size: var(--mh-text-xs); font-weight: 700; letter-spacing: var(--mh-tracking-caps); text-transform: uppercase; color: var(--mh-ink-muted); background: var(--mh-subtle); border-bottom-color: var(--mh-line); }

/* Helpers. */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--mh-space-6); }
.inline { display: inline-block; }
pre { overflow: auto; }

@media (max-width: 700px) {
  body { padding: var(--mh-space-3); }
  .grid { grid-template-columns: 1fr; }
  nav { gap: var(--mh-space-2); font-size: var(--mh-text-small); }
  form.account { margin: var(--mh-space-5) auto; }
  table { font-size: var(--mh-text-nav); }
  th, td { padding: var(--mh-space-2); }
}
