/* Sigilet customer portal. Light and dark, no build step, no dependencies. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --border: #e3e1dd;
  --text: #1c1b19;
  --muted: #6b6862;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --ok: #2f6f4f;
  --ok-bg: #e8f3ec;
  --warn: #8a5a12;
  --warn-bg: #fbf1de;
  --bad: #97331f;
  --bad-bg: #fbeae6;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 12px rgb(0 0 0 / 4%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --surface: #1e1e23;
    --border: #33333b;
    --text: #eceae6;
    --muted: #9b968e;
    --accent: #7fbfa8;
    --accent-text: #10241d;
    --ok: #8fd0ae;
    --ok-bg: #1c2f26;
    --warn: #e0b872;
    --warn-bg: #322818;
    --bad: #e79483;
    --bad-bg: #33201c;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code, .prefix, .version { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

h1 { font-size: 1.5rem; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 2rem 0 .75rem; letter-spacing: -.005em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.loading { color: var(--muted); padding: 3rem 0; text-align: center; }

/* Bar ------------------------------------------------------------------ */

.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.brand { font-weight: 650; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.bar-right { display: flex; align-items: center; gap: .9rem; font-size: .9rem; }

#mock-banner {
  padding: .5rem 1.25rem; font-size: .85rem;
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid var(--border);
}
#mock-banner code { font-size: .95em; }

main { max-width: 780px; margin: 0 auto; padding: 2rem 1.25rem 5rem; }

/* Panels and forms ----------------------------------------------------- */

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow);
}
.narrow { max-width: 26rem; margin: 3rem auto; }

label { display: block; font-size: .85rem; font-weight: 550; margin: 1.25rem 0 .35rem; }

input {
  width: 100%; padding: .6rem .7rem; font: inherit;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 7px;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

button { font: inherit; cursor: pointer; border-radius: 7px; }
button[disabled] { opacity: .5; cursor: not-allowed; }

.primary {
  width: 100%; margin-top: 1.1rem; padding: .65rem 1rem; font-weight: 550;
  color: var(--accent-text); background: var(--accent); border: 1px solid transparent;
}
.secondary {
  padding: .4rem .8rem; font-size: .85rem;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
}
.secondary:hover:not([disabled]) { border-color: var(--muted); }
.destructive {
  margin-top: 1.1rem; padding: .55rem 1rem; font-weight: 550;
  color: #fff; background: var(--bad); border: 1px solid transparent;
}
.link {
  padding: 0; background: none; border: 0; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px; font-size: inherit;
}

.error {
  margin-top: 1rem; padding: .6rem .75rem; font-size: .875rem;
  color: var(--bad); background: var(--bad-bg);
  border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent);
  border-radius: 7px;
}

.dev-only { border-left: 2px solid var(--border); padding-left: .9rem; }

/* Licence cards -------------------------------------------------------- */

.cards, .sites, .releases { list-style: none; margin: 0; padding: 0; }
.cards { display: grid; gap: .85rem; }

.card { background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow); }
.card-link { display: block; padding: 1.1rem 1.25rem; color: inherit; text-decoration: none; }
.card-link:hover { border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 4%, transparent); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tier { font-weight: 600; text-transform: capitalize; }
.prefix { font-size: .9rem; color: var(--muted); }

.badge {
  padding: .15rem .55rem; font-size: .75rem; font-weight: 600;
  border-radius: 999px; white-space: nowrap;
}
.badge.ok   { color: var(--ok);   background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad  { color: var(--bad);  background: var(--bad-bg); }

.seats { display: flex; align-items: center; gap: .7rem; margin: .8rem 0 .4rem; }
.meter { flex: 1; height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter span.full { background: var(--warn); }
.seats .muted { font-size: .8rem; white-space: nowrap; }

/* Detail --------------------------------------------------------------- */

.back { display: inline-block; margin-bottom: 1.25rem; color: var(--muted);
        font-size: .875rem; text-decoration: none; }
.back:hover { color: var(--text); }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.detail-head h1 { text-transform: capitalize; }

.note {
  margin: 1.5rem 0; padding: .85rem 1rem; font-size: .9rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 7px;
}

.site, .release {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: .5rem;
}
.site p, .release p { margin: .15rem 0 0; }
.site-url { color: var(--text); font-weight: 500; text-decoration: none; word-break: break-all; }
.site-url:hover { text-decoration: underline; }
.version { font-weight: 600; }
.release.unavailable { opacity: .6; }

.danger-heading { color: var(--bad); }
.danger {
  padding: 1.1rem 1.25rem; font-size: .9rem;
  background: var(--bad-bg); border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent);
}
.danger p { margin: 0; }
.danger input { max-width: 16rem; background: var(--surface); }

@media (max-width: 480px) {
  .site, .release { flex-direction: column; align-items: stretch; }
  .site button, .release button { width: 100%; }
}
