/* Application shell. Every colour comes from a --brand-* token defined by the
   per-tenant /theme.css, so this file is identical for every practice. */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 1.25rem;
  /* Both come from /theme.css, which resolves them per theme — this file must
     not carry its own prefers-color-scheme block or the two disagree. */
  background: var(--brand-surface, #fbfaf8);
  color: var(--brand-on-surface, #1c1917);
  font-family: var(--brand-font, system-ui, sans-serif);
  line-height: 1.6;
}

.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
  max-width: 26rem;
}

.logo {
  width: auto;
  height: 96px;
  max-width: 100%;
  margin-bottom: 0.5rem;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.tagline {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.72;
}

.notice {
  margin: 0.75rem 0 0;
  padding: 0.7rem 1.1rem;
  border-left: 3px solid var(--brand-primary, #1f4e5f);
  background: color-mix(in srgb, var(--brand-primary, #1f4e5f) 8%, transparent);
  font-size: 0.9rem;
  text-align: left;
}

.support { margin: 0; font-size: 0.85rem; opacity: 0.7; }

footer {
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

a { color: var(--brand-primary, #1f4e5f); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand-accent, #c9682f);
  outline-offset: 2px;
}

/* ---- toolbox ----------------------------------------------------------- */

.toolbox {
  width: 100%;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.toolbox h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tool {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.tool:hover {
  border-color: var(--brand-primary, #1f4e5f);
  background: color-mix(in srgb, var(--brand-primary, #1f4e5f) 6%, transparent);
}

.tool-name {
  font-weight: 600;
  color: var(--brand-primary, #1f4e5f);
}

.tool-desc {
  font-size: 0.87rem;
  opacity: 0.75;
}

/* ---- authentication ---------------------------------------------------- */

.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 22rem;
  text-align: center;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
}

.form label {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.8;
}

.form input {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 4%, transparent);
  color: inherit;
  margin-bottom: 0.4rem;
}

.form input:focus-visible {
  outline: 2px solid var(--brand-primary, #1f4e5f);
  outline-offset: 1px;
}

.primary {
  font: inherit;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--brand-primary, #1f4e5f);
  color: var(--brand-primary-ink, #fff);
  cursor: pointer;
}

.primary:hover { filter: brightness(1.08); }

.form-error {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid #b3332a;
  background: color-mix(in srgb, #b3332a 10%, transparent);
  font-size: 0.88rem;
}

.form-hint {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.78;
}

/* The TOTP setup key. Monospace and spaced so it can be read aloud or typed. */
.secret-key {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  word-break: break-all;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  margin: 0;
}

.inline-form { margin: 0; }

.link-button {
  font: inherit;
  font-size: 0.88rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-accent, #c9682f);
  text-decoration: underline;
  cursor: pointer;
}

/* One-time recovery codes. Monospace and generously spaced, because these get
   written down or printed, and a misread character costs an account. */
.recovery-codes {
  list-style: none;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 1rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

@media (max-width: 26rem) {
  .recovery-codes { grid-template-columns: 1fr; }
}

/* TOTP setup QR. The code itself is always dark-on-white regardless of theme —
   scanners expect that polarity, and inverting it breaks some of them. */
.qr {
  align-self: center;
  line-height: 0;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
}

.qr svg {
  display: block;
  width: 232px;
  height: 232px;
  max-width: 100%;
}

.fallback {
  font-size: 0.9rem;
  border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  padding-top: 0.7rem;
}

.fallback summary {
  cursor: pointer;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.fallback summary:focus-visible {
  outline: 2px solid var(--brand-accent, #c9682f);
  outline-offset: 2px;
}
