/* Components. Colours and spacing come from tokens.css — no literals here. */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Links are ink with an underline, not a colour. At this density a coloured
   link in every other row is noise. */
a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px;
    text-decoration-color: var(--border-strong); }
a:hover { text-decoration-color: var(--ink-muted); }

/* ------------------------------------------------------------------ auth */

/* The login screen is the one place Playfair appears alongside the wordmark,
   as brand connective tissue to pinfluencemedia.com (§5.3). */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
}

.auth-card {
  width: 100%;
  /* Wide enough that the wordmark and the line under it each hold one line. */
  max-width: 408px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-6);
}

.auth-mark {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-1);
}

/* The Pinfluence Media pin. The only brand colour on the screen — everything
   else is graphite and gray, so the mark is what the eye lands on. */
.mark { flex: none; display: block; }

.auth-sub {
  color: var(--ink-muted);
  font-size: var(--text-md);
  margin: 0 0 var(--sp-5);
}

.field { margin-bottom: var(--sp-4); }

.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: var(--sp-1);
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-3);
  font-family: inherit;
  font-size: var(--text-md);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease);
}

.field input:focus {
  outline: none;
  border-color: var(--ink-secondary);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

/* The code input: monospace and wide-tracked, because six digits read as
   digits, not as a word (§5.4). */
.field input.code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: 22px;
  letter-spacing: 0.32em;
  text-align: center;
  padding-left: 0.32em;   /* re-centre: tracking adds a trailing gap */
  height: 52px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-4);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}

.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(0.5px); }

.btn-quiet {
  color: var(--ink-secondary);
  background: transparent;
  border-color: var(--border-strong);
}

.btn-quiet:hover { background: var(--surface-sunk); color: var(--ink); }

/* ---------------------------------------------------------------- icons */

/* Tabler icons, inlined as SVG. currentColor means they take the colour of
   whatever they sit in, so there is never an icon-specific colour rule. */
.icon {
  flex: none;
  vertical-align: -0.185em;   /* optical baseline against 13-14px UI text */
}

.btn .icon { margin-right: var(--sp-2); vertical-align: 0; }
.linkish .icon { margin-right: var(--sp-1); }

/* The wordmark rule and the icon that replaces it on other auth screens need
   the same optical gap before the display type. */
.mark-icon { color: var(--ink-muted); vertical-align: -0.12em; margin-right: var(--sp-2); }

/* Errors state what happened and what to do, and never apologise (§6.5). */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
}

.notice .icon { margin-top: 1px; }

.notice-error { background: var(--danger-wash); color: var(--danger); }
.notice-info  { background: var(--info-wash);   color: var(--info); }

.auth-foot {
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  text-align: center;
}

.auth-foot form { display: inline; }

.linkish {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink-secondary);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}

.linkish:hover { color: var(--ink); text-decoration-color: var(--ink-muted); }

/* ------------------------------------------------------------------ app */

.masthead {
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.masthead .wordmark {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin: 0;
}

.masthead .spacer { flex: 1; }

.masthead .who {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.wrap { padding: var(--sp-5); }

.page-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--sp-4);
}

.muted { color: var(--ink-muted); }

.t-id {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}
