/* -------------------------------------------------------------------------
   RICH | SERVICES - shared styles for the license site and the admin panel
   ---------------------------------------------------------------------- */

:root {
  --bg: #0c0c11;
  --bg-soft: #12121a;
  --panel: #16161f;
  --panel-2: #1c1c27;
  --line: #262633;
  --line-soft: #1f1f2b;

  --gold: #f1c40f;
  --gold-dim: #b08f0c;
  --gold-soft: rgba(241, 196, 15, 0.12);

  --text: #e8e8ef;
  --muted: #8b8b9c;
  --dim: #5c5c6b;

  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;
  --purple: #a78bfa;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(1100px 500px at 50% -180px, rgba(241, 196, 15, 0.10), transparent 70%),
    radial-gradient(800px 400px at 100% 100%, rgba(122, 92, 255, 0.07), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
}

/* -- header ------------------------------------------------------------- */
.topbar {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(12, 12, 17, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 13px;
  text-transform: uppercase;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--gold), #7a5cff);
  display: grid;
  place-items: center;
  color: #14100a;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0;
}

.brand span.gold { color: var(--gold); }

.topnav { display: flex; align-items: center; gap: 22px; font-size: 13px; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--text); text-decoration: none; }

/* -- hero --------------------------------------------------------------- */
.hero { padding: 68px 0 30px; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(241, 196, 15, 0.28);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 6px 14px;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
  margin: 22px 0 14px;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero p {
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 16px;
}

/* -- panels ------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 18px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.panel .hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}

.section { padding: 26px 0 60px; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.section-title p { margin: 0; color: var(--muted); font-size: 13px; }

/* -- hardware id block -------------------------------------------------- */
.hwid-box {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.hwid-value {
  flex: 1 1 320px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  background: #0a0a0f;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--gold);
  word-break: break-all;
  line-height: 1.4;
}

.hwid-value.pending { color: var(--dim); }

/* -- forms -------------------------------------------------------------- */
label.field {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 7px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: #0a0a0f;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.mono, textarea.mono { font-family: var(--mono); letter-spacing: 0.04em; }

input:focus, select:focus, textarea:focus {
  border-color: rgba(241, 196, 15, 0.55);
  box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.12);
}

input::placeholder { color: #4a4a58; }

.field-row { margin-bottom: 15px; }

.field-row.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 640px) {
  .field-row.split { grid-template-columns: 1fr; }
}

/* -- buttons ------------------------------------------------------------ */
button, .btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 11px 18px;
  cursor: pointer;
  background: var(--panel-2);
  color: var(--text);
  transition: transform 0.12s ease, filter 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

button:hover, .btn:hover { filter: brightness(1.14); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #e0a800);
  color: #1a1403;
  border-color: rgba(0, 0, 0, 0.2);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-ghost:hover { color: var(--text); border-color: #3a3a4a; }

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* -- status pills ------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill.active { color: var(--green); background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.3); }
.pill.revoked { color: var(--red); background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); }
.pill.suspended { color: var(--purple); background: rgba(167, 139, 250, 0.1); border-color: rgba(167, 139, 250, 0.3); }
.pill.expired { color: var(--muted); background: rgba(139, 139, 156, 0.1); border-color: rgba(139, 139, 156, 0.28); }
.pill.gold { color: var(--gold); background: var(--gold-soft); border-color: rgba(241, 196, 15, 0.3); }
.pill.blue { color: var(--blue); background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.3); }

/* -- stats -------------------------------------------------------------- */
.stat {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat .label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat .value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat .value.gold { color: var(--gold); }
.stat .value.green { color: var(--green); }
.stat .value.red { color: var(--red); }
.stat .value.blue { color: var(--blue); }

/* -- tables ------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 13px 16px;
  background: #101017;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.022); }

td.mono, .mono { font-family: var(--mono); }
td.wrap { word-break: break-all; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* -- toolbar ------------------------------------------------------------ */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .search { flex: 1 1 260px; }
.toolbar select { width: auto; min-width: 140px; }

/* -- messages ----------------------------------------------------------- */
.msg {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  margin: 14px 0 0;
  display: none;
  border: 1px solid transparent;
}

.msg.show { display: block; }
.msg.ok { color: #bbf7d0; background: rgba(74, 222, 128, 0.09); border-color: rgba(74, 222, 128, 0.28); }
.msg.bad { color: #fecaca; background: rgba(248, 113, 113, 0.09); border-color: rgba(248, 113, 113, 0.28); }
.msg.info { color: #bfdbfe; background: rgba(96, 165, 250, 0.09); border-color: rgba(96, 165, 250, 0.28); }

/* -- product cards ------------------------------------------------------ */
.product {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  position: relative;
  overflow: hidden;
}

.product::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.product h3 { margin: 0 0 6px; font-size: 15px; letter-spacing: 0.02em; }
.product p { margin: 0; color: var(--muted); font-size: 13px; }

/* -- modal -------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 9, 0.78);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 20px;
  z-index: 80;
  overflow-y: auto;
}

.modal-backdrop.open { display: flex; }

.modal {
  width: min(620px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: pop 0.16s ease-out;
}

@keyframes pop {
  from { transform: translateY(-8px) scale(0.985); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.x-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

.x-btn:hover { color: var(--text); filter: none; }

/* -- device list -------------------------------------------------------- */
.device {
  border: 1px solid var(--line-soft);
  background: #0e0e15;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.device .hw {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  word-break: break-all;
}

.device .meta { color: var(--dim); font-size: 11.5px; margin-top: 3px; }

/* -- login -------------------------------------------------------------- */
.login-wrap {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 40px 0;
}

.login-card { width: min(420px, 100%); }

/* -- toast -------------------------------------------------------------- */
#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 120;
}

.toast {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  max-width: 360px;
  animation: slide 0.18s ease-out;
}

.toast.bad { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }

@keyframes slide {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* -- misc --------------------------------------------------------------- */
.hidden { display: none !important; }

.footer {
  border-top: 1px solid var(--line-soft);
  padding: 26px 0 40px;
  color: var(--dim);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: #0a0a0f;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--gold);
}

.copyable { cursor: pointer; }
.copyable:hover { text-decoration: underline dotted; }
