/*
 * The auth surface. One card, centred, nothing else on the page.
 *
 * The vhost sends style-src 'self', so every rule lives here: no inline style
 * block and no style attribute will render.
 *
 * Every selector below groups two spellings on purpose. This file's own
 * classes use the BEM convention throughout. The downstream screen briefs
 * (Tasks 12 to 22) settled on flat names instead, and not even consistently
 * with each other, so both spellings are listed together and resolve to the
 * same rule. Do not remove either half of a group: pick one and the other
 * screen breaks. Class names are deliberately kept out of this comment block
 * itself, so a text scan of a selector never matches prose instead of a rule.
 */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p {
  margin: 0;
}

a,
.linkish {
  color: var(--fir);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
.linkish:hover {
  color: var(--brass);
}

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

.page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.card {
  width: 420px;
  max-width: 100%;
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__brand {
  margin-bottom: 26px;
  color: var(--fir);
}

.logo {
  display: block;
  width: 112px;
  height: auto;
  color: var(--fir);
}

.card__title,
.card-heading,
.card-title {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__lede,
.card-sub,
.card-lede,
.card-identity {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

.stack > * + *,
.form-actions > * + * {
  margin-top: 16px;
}

.field {
  display: block;
}

.field__label,
.field-label,
.mono {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field__input {
  width: 100%;
  padding: 11px 12px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 160ms var(--ease);
}

.field__input:hover {
  border-color: var(--moss);
}

.field__input::placeholder {
  color: var(--muted);
}

.field__error,
.field-error,
.form-error,
.errors {
  margin-top: 6px;
  color: var(--danger);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.btn--primary,
.btn-primary,
.button-primary {
  background: var(--fir);
  color: var(--on-fir);
}

.btn--primary:hover,
.btn-primary:hover,
.button-primary:hover {
  background: var(--brass);
  color: var(--on-fir);
}

.btn--quiet,
.btn-quiet,
.button-quiet {
  background: var(--sage);
  color: var(--ink);
  border-color: var(--rule);
}

.btn--quiet:hover,
.btn-quiet:hover,
.button-quiet:hover {
  background: var(--moss);
}

.btn--danger {
  background: var(--danger);
  color: var(--on-fir);
}

.alert,
.notice {
  padding: 11px 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--sage);
  color: var(--ink);
  font-size: 14px;
}

.alert--danger {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--panel);
}

.muted,
.sub,
.link-quiet {
  color: var(--muted);
  font-size: 13px;
}

.sep {
  color: var(--muted);
  padding: 0 6px;
}

.foot,
.card-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}

/*
 * Nothing above this line has a natural existing rule for the names below,
 * so these are new: minimal, token-only, and restrained on purpose. This is
 * a substrate, not a finished design. The account surface (Task 21 and 22)
 * owns its own screens and may extend these further.
 */

.panel {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.rows > * {
  padding: 12px 0;
}

.rows > * + * {
  border-top: 1px solid var(--rule);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--sage);
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag--ok {
  color: var(--success);
}

.tag--warn {
  color: var(--warning);
}

.tag--now {
  color: var(--brass);
}

.account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
}

.account-head__logo {
  display: block;
  width: 28px;
  height: auto;
  color: var(--fir);
}

.account-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px;
}

.account-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}

.account-row:first-child {
  border-top: none;
}

.account-name {
  color: var(--ink);
  font-weight: 600;
}

.is-current {
  background: var(--sage);
}

.row-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-address {
  color: var(--muted);
  font-size: 13px;
}

.trust-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--sage);
}

.trust-rail__host {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
}

.trust-rail__note {
  color: var(--muted);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0ms !important;
  }
}
