@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFB;
  --text: #1B1B1B;
  --muted: #5F6B76;
  --line: #E3E7EB;
  --accent: #0E9F6E;
  --accent-hover: #0B8A5F;
  --accent-text: #0B7F59;
  --accent-soft: #E7F6F0;
  --danger: #D32F2F;
  --danger-soft: #FDECEC;
  --warn-soft: #FFF6E0;
  --warn-line: #F2D18A;
  --shadow: rgba(16, 24, 40, 0.06) 0 6px 24px 0, rgba(16, 24, 40, 0.06) 0 0 0 1px;
  --shadow-up: rgba(16, 24, 40, 0.12) 0 12px 32px 0, rgba(16, 24, 40, 0.06) 0 0 0 1px;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111416; --surface: #1A1E21; --surface-2: #20252A; --text: #ECEFF1; --muted: #9AA6B1; --line: #2C3338;
    --accent: #22B47F; --accent-hover: #1C9C6D; --accent-text: #4CD39F; --accent-soft: #15322A;
    --danger: #EF5350; --danger-soft: #3A1C1C; --warn-soft: #33290F; --warn-line: #6B5318;
    --shadow: rgba(0, 0, 0, 0.35) 0 6px 24px 0, rgba(255, 255, 255, 0.05) 0 0 0 1px;
    --shadow-up: rgba(0, 0, 0, 0.5) 0 12px 32px 0, rgba(255, 255, 255, 0.07) 0 0 0 1px;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; font-size: 15px; line-height: 1.55;
  background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent-text); }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; }
.muted { color: var(--muted); margin: 0 0 16px; }
.small { font-size: 13px; }
.g { color: var(--accent); }

/* bar */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 18px; white-space: nowrap; }
.brand b { font-weight: 700; }
.bar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.link { text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.who { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 24px 56px; }

/* cards + buttons */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; padding: 11px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background-color .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); color: #FFFFFF; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #FFFFFF; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.wide { width: 100%; margin-top: 6px; }
.btn:focus-visible, .link-btn:focus-visible, input:focus-visible, .drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.spin { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: turn .7s linear infinite; }
.btn.busy .spin { display: inline-block; }
@keyframes turn { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent-text); cursor: pointer; }
.link-btn:disabled { color: var(--muted); cursor: default; font-weight: 400; }

label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
input[type=email], input[type=text] {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); margin-bottom: 12px;
}
input.code { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.error { color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 9px 12px; margin: 0 0 12px; font-size: 14px; }
.ok { color: var(--accent-text); background: var(--accent-soft); border-radius: 8px; padding: 9px 12px; margin: 0 0 12px; font-size: 14px; }
.row-links { display: flex; justify-content: space-between; margin-top: 12px; }
.hint { margin: 12px 0 0; }

/* sign in */
.signin { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; min-height: 60vh; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 22px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; font-weight: 600; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft);
}
.ticks li::after {
  content: ""; position: absolute; left: 8px; top: 6px; width: 6px; height: 10px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.signin-card { padding: 30px; max-width: 440px; width: 100%; justify-self: end; animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* dashboard */
.dash-head { margin-bottom: 20px; }
.dash-head .muted { margin: 0; }
.notice { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.licences { display: grid; gap: 18px; margin-bottom: 22px; }
.lic { animation: rise .35s ease-out both; transition: box-shadow .2s; }
.lic:hover { box-shadow: var(--shadow-up); }
.lic-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lic-top h2 { margin: 0; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.chip.on { background: var(--accent-soft); color: var(--accent-text); }
.chip.off { background: var(--danger-soft); color: var(--danger); }
.keyrow { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; }
.keyrow code { flex: 1; font-family: Consolas, "Cascadia Mono", monospace; font-size: 16px; font-weight: 700; letter-spacing: .04em; overflow-wrap: anywhere; min-width: 0; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.facts div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); margin: 0 0 2px; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pcs-title { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.pcs { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.pcs li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.pcs li + li { border-top: 1px solid var(--line); }
.pc-icon { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); position: relative; }
.pc-icon::before { content: ""; position: absolute; left: 8px; top: 9px; width: 18px; height: 12px; border: 2px solid var(--accent); border-radius: 2px; }
.pc-icon::after { content: ""; position: absolute; left: 12px; top: 24px; width: 10px; height: 2px; background: var(--accent); }
.pc-text { flex: 1; min-width: 0; }
.pc-text b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-text span { color: var(--muted); font-size: 13px; }
.empty { padding: 14px; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.steps { padding-left: 20px; margin: 8px 0 16px; display: grid; gap: 8px; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 16px; margin: 0 0 14px; cursor: pointer;
  transition: border-color .15s, background-color .15s; font-weight: 400;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-main { font-weight: 600; overflow-wrap: anywhere; }
.drop-sub { color: var(--muted); font-size: 13px; }

.skeleton { display: grid; gap: 12px; }
.skeleton span { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton span:nth-child(1) { width: 40%; height: 22px; }
.skeleton span:nth-child(2) { width: 100%; height: 44px; }
.skeleton span:nth-child(3) { width: 70%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.loading { display: flex; justify-content: center; padding: 80px 0; }
.loader { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: turn .8s linear infinite; }

/* footer */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; padding: 18px 16px 24px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(10, 14, 18, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; animation: fade .15s ease-out both; }
.modal-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-up); padding: 26px; max-width: 440px; width: 100%; animation: rise .2s ease-out both; }
.modal-box p { color: var(--muted); margin: 0 0 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1B1B1B; color: #FFFFFF;
  padding: 11px 18px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow-up); z-index: 30; max-width: calc(100% - 32px);
  animation: rise .2s ease-out both;
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 900px) {
  .signin { grid-template-columns: 1fr; gap: 28px; min-height: 0; }
  .signin-card { justify-self: stretch; max-width: none; }
  .grid2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .bar { padding: 10px 16px; }
  .brand { font-size: 16px; }
  .who { display: none; }
  main { padding: 24px 16px 40px; }
  h1 { font-size: 24px; }
  .card { padding: 18px; }
  .signin-card { padding: 22px; }
  .pcs li { flex-wrap: wrap; }
  .pcs li .btn { width: 100%; }
  .keyrow { flex-wrap: wrap; }
  .keyrow code { flex-basis: 100%; }
}
