/* authcore, the provider hosted pages: login, consent, account, errors.
   One small stylesheet with no build step. Fonts are self hosted because the
   CSP forbids external requests. */

@font-face {
  font-family: 'Plex Sans';
  src: url('/static/fonts/plex-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Mono';
  src: url('/static/fonts/plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/static/fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/static/fonts/plex-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/static/fonts/plex-mono-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* Dark only, by design. The mockups committed to one look rather than a pair. */
:root {
  color-scheme: dark;

  --ground: #0b0b0d;
  --surface: #131317;
  --inset: #0c0c0e;

  --line: #26262b;
  --line-soft: #2a2a30;
  --line-mute: #3a3a40;

  --text: #f4f4f6;
  --brand: #e8e8ea;
  --text-2: #b6b6bd;
  --text-3: #8a8a92;
  --text-4: #7a7a83;
  --text-5: #6f6f77;
  --label: #5c5c64;

  --action: #a5a2f5;
  --action-deep: #6d69d6;
  --on-action: #161421;

  --caution: #f0b429;
  --caution-deep: #b8860f;
  --caution-line: #4a3c1a;
  --on-caution: #1a1405;

  --danger: #ff6b6b;
  --danger-line: #4a2b2b;
  --danger-dim: #9a6b6b;

  --ok: #7fd18b;

  --sans: 'Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- card ---------------------------------------------------------------- */

.card {
  width: 100%;
  max-width: 25.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.card--wide { max-width: 42rem; }

/* The dashed cap is the provider's signature, reused on every hosted page. */
.card::before {
  content: '';
  display: block;
  height: 5px;
  opacity: 0.5;
  background: repeating-linear-gradient(90deg, var(--action) 0 2px, transparent 2px 6px);
}

.card__body { padding: 1.9rem 2rem 2.15rem; }

/* --- brand --------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}

.brand__mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.5px;
  color: var(--brand);
}

.brand__issuer {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--label);
  overflow-wrap: anywhere;
}

.brand__status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.5625rem;
  letter-spacing: 1px;
  color: var(--ok);
  white-space: nowrap;
}

.brand__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}

/* --- type ---------------------------------------------------------------- */

h1 {
  margin: 0;
  font-size: 1.5625rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}

.lede {
  margin: 0.3rem 0 1.6rem;
  font-size: 0.875rem;
  color: var(--text-3);
}

.section {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.625rem;
  letter-spacing: 2px;
  color: var(--text-5);
  margin: 2rem 0 0.85rem;
}

.mono { font-family: var(--mono); }

.code {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* --- form ---------------------------------------------------------------- */

label {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

input[type='email'],
input[type='password'] {
  width: 100%;
  height: 2.875rem;
  padding: 0 0.85rem;
  margin-bottom: 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--inset);
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
}

input::placeholder { color: var(--text-5); }

input:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(165, 162, 245, 0.16);
}

/* --- buttons ------------------------------------------------------------- */

button,
.btn {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  height: 3rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* The 3px underside reads as a key cap, and marks the committing action. */
.btn-primary {
  width: 100%;
  background: var(--action);
  border-bottom: 3px solid var(--action-deep);
  color: var(--on-action);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--text-2);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-size: 0.75rem;
  height: 2.375rem;
}

.btn-row { display: flex; gap: 0.65rem; }
.btn-row > * { flex: 1; }

/* Consent gives both answers the same size and contrast class. Allow carries
   the accent border only, enough to find, not enough to pull the thumb. */
.btn-allow {
  background: transparent;
  border: 1.5px solid var(--action);
  color: var(--action);
}

.btn-deny {
  background: transparent;
  border: 1.5px solid var(--line-mute);
  color: var(--text-2);
}

/* --- badges -------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.625rem;
  letter-spacing: 1px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line-mute);
  border-radius: 5px;
  color: var(--text-2);
  text-transform: uppercase;
}

.badge--current {
  background: rgba(127, 209, 139, 0.14);
  border-color: var(--ok);
  color: var(--ok);
}

.badge--admin { border-color: var(--action); color: var(--action); }

/* --- scope list ---------------------------------------------------------- */

.scopes { list-style: none; margin: 0 0 1.6rem; padding: 0; }

.scopes li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.scopes li:first-child { border-top: 1px solid var(--line); }

.scopes__name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--action);
}

.scopes__desc { font-size: 0.875rem; color: var(--text); }

.scopes__note {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--text-5);
}

/* --- rows ---------------------------------------------------------------- */

.rows { border-top: 1px solid var(--line); }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}

.row__main { min-width: 0; }

.row__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.row__meta {
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--text-4);
  overflow-wrap: anywhere;
}

.row__meta b { color: var(--label); font-weight: 400; }

.row form { margin: 0; }

/* --- alert and error ----------------------------------------------------- */

.alert {
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--danger-line);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.06);
  color: var(--danger);
  font-size: 0.85rem;
}

.errcode {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.625rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--danger);
  border: 1px solid var(--danger-line);
  background: rgba(255, 107, 107, 0.07);
  border-radius: 5px;
  padding: 0.25rem 0.5rem;
  margin-bottom: 1rem;
}

.detail {
  margin-top: 1.1rem;
  padding: 0.8rem 0.9rem;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--text-4);
  overflow-wrap: anywhere;
}

.detail b { color: var(--label); font-weight: 400; }

/* --- footer -------------------------------------------------------------- */

.footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-5);
}

.footer a { color: var(--action); }

.empty {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-5);
}

/* --- mobile -------------------------------------------------------------- */

@media (max-width: 640px) {
  body {
    padding: 1.25rem 1rem;
    padding-top: calc(1.25rem + env(safe-area-inset-top));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    align-items: flex-start;
  }

  .card__body { padding: 1.5rem 1.25rem 1.65rem; }

  h1 { font-size: 1.3125rem; }

  .row { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .row form { width: 100%; }
  .row button { width: 100%; }

  .btn-row { flex-direction: column-reverse; }
}

@media (pointer: coarse) {
  /* iOS Safari zooms the page when a focused input is under 16px. */
  input[type='email'],
  input[type='password'] {
    font-size: 16px;
  }

  button, .btn { min-height: 44px; }
  .btn-danger { height: 44px; }
}

/* The login page drops its lede, so the heading carries the gap to the form. */
h1.lede-gap { margin-bottom: 1.6rem; }
