/* Licence portal: the website's look (palletdesigner.com: Plus Jakarta Sans, sky and ink), no
   framework. Rule of the owner: nothing jumps. The notice slot, the key field, the seat slots and
   the amounts have fixed sizes and are there also while empty; buttons that change their label
   keep their width.
   Plus Jakarta Sans: Tokotype, SIL Open Font License 1.1 (same file as the website). */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/portal/static/PlusJakartaSans-VF.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --sky: #3ec5f3;
  --sky-deep: #0a7ea8;
  --sky-dark: #08678a;
  --sky-soft: #d6eef9;
  --sky-mist: #ecf6fb;
  --bg: #fbfaf4;
  --ink: #0a2c3d;
  --ink-soft: #4f6c7a;
  --ink-faded: #8aa1ad;
  --surface: #ffffff;
  --line: #e6eef2;
  --mint-soft: #e8f7ef;
  --green: #1b7a43;
  --peach-soft: #fff1e3;
  --amber: #b86826;
  --warn: #b3261e;
  --rose-soft: #fdeceb;
  --radius: 14px;
  --notice-h: 3.25rem;
  --slot-h: 2.75rem;
  --control-h: 2.5rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  /* the scroll bar's space is always kept: a page growing past the window does not shift it */
  overflow-y: scroll;
}

a { color: var(--sky-deep); }
a:hover { color: var(--sky-dark); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 700; margin-top: 1rem; color: var(--ink-soft); }
p { margin: 0 0 0.75rem; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }

/* header and tabs ------------------------------------------------------------------------- */

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner, .tabs-inner, main, footer {
  max-width: 960px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  gap: 1rem;
}
.brand { font-weight: 800; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { font-weight: 500; color: var(--ink-soft); margin-left: 0.35rem; }
.langs { display: flex; gap: 0.5rem; }
.langs a {
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}
.langs a[aria-current] { background: var(--sky-mist); color: var(--sky-deep); }

.tabs { border-top: 1px solid var(--line); }
/* fixed height, also before sign-in, so the page below starts at the same place */
.tabs-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 2.75rem;
  overflow-x: auto;
  white-space: nowrap;
}
.tabs a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.6rem 0;
  border-bottom: 2px solid transparent;
}
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--sky); }
.tabs .logout { margin-left: auto; }

/* page ------------------------------------------------------------------------------------- */

main { padding-top: 1rem; padding-bottom: 2rem; }

.notice {
  height: var(--notice-h);
  overflow-y: auto;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.925rem;
  border: 1px solid transparent;
}
.notice-ok { background: var(--mint-soft); color: var(--green); border-color: #cfeee0; }
.notice-warn { background: var(--peach-soft); color: var(--amber); border-color: #ffe0c8; }
.notice-error { background: var(--rose-soft); color: var(--warn); border-color: #f6cdca; }

.page-title { margin-bottom: 0.75rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 40px -12px rgba(10, 80, 110, 0.10);
}
.card.narrow { max-width: 560px; }
.card.danger { border-color: #f6cdca; }

.licence-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.badge {
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--sky-mist);
  color: var(--sky-deep);
}
.badge-active { background: var(--mint-soft); color: var(--green); }
.badge-suspended, .badge-expired { background: var(--peach-soft); color: var(--amber); }

.order-note { font-size: 0.9rem; color: var(--ink-soft); }
.order-note.warn { color: var(--warn); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0;
}
.fact dt { font-size: 0.8rem; color: var(--ink-faded); font-weight: 600; }
.fact dd { margin: 0; font-weight: 600; }
.fact-key, .fact-wide { grid-column: 1 / -1; }
.fact-key dd { display: flex; align-items: center; gap: 0.75rem; }

/* the key: one line of fixed height; a long key scrolls inside, nothing around it moves */
.key {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--control-h);
  line-height: calc(var(--control-h) - 2px);
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sky-mist);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  user-select: all;
}
.hash {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

/* seats: one slot per seat, of fixed height; a released computer leaves a free slot */
.slots { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: var(--slot-h);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 0.4rem;
}
.slot-free { color: var(--ink-faded); border-style: dashed; }
.slot-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-button { width: 8rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* forms and buttons ------------------------------------------------------------------------ */

form.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
label { font-weight: 600; font-size: 0.925rem; }
.choice { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
legend { font-weight: 600; font-size: 0.925rem; margin-bottom: 0.35rem; }

input[type=email], input[type=number], input:not([type]), select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cbdbe3;
  border-radius: 8px;
  padding: 0 0.7rem;
  height: var(--control-h);
  width: 100%;
  max-width: 28rem;
}
textarea { height: auto; padding: 0.5rem 0.7rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .button:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 1px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  padding: 0 1rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.925rem;
  color: var(--sky-deep);
  background: var(--surface);
  border: 1px solid var(--sky-soft);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--sky-mist); }
button.primary, .button.primary { background: var(--sky-deep); border-color: var(--sky-deep); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--sky-dark); }
button.danger { color: var(--warn); border-color: #f6cdca; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.small, .button.small { height: 2rem; font-size: 0.85rem; padding: 0 0.8rem; }
button.link {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-weight: 600;
}
button.link:hover { color: var(--ink); background: none; }

/* amounts: rows always there, a dash until Paddle answers */
.amounts { margin: 0.5rem 0; border-top: 1px solid var(--line); }
.amounts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  height: 2.5rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.amounts dt { color: var(--ink-soft); }
.amounts dd { margin: 0; font-weight: 700; white-space: nowrap; }

.activity { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.activity li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.plain { padding-left: 1.1rem; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--ink-faded);
}

/* phones ---------------------------------------------------------------------------------- */

@media (max-width: 600px) {
  :root { --notice-h: 4.5rem; }
  h1 { font-size: 1.3rem; }
  .brand span { display: none; }
  .card { padding: 1rem; }
  .slot-button { width: 6.5rem; }
  .tabs-inner { gap: 0.9rem; }
  .tabs a, .tabs button.link { font-size: 0.85rem; }
  .facts { grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; }
  .fact-key dd { flex-wrap: wrap; }
  .key { flex-basis: 100%; }
}
