/* Ratin Special — My Account (dashboard)
   Same look as login: dark surface, yellow accent. Change --accent / --accent-ink to recolour. */
:root {
  --bg: #0a0a0c;
  --surface: #151517;
  --surface-2: #1a1a1c;
  --field: #1e1e21;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f0efe9;
  --muted: #87858c;
  --accent: #d8c84a;
  --accent-ink: #1a1900;
  --danger: #ff8a8d;
  --danger-bg: rgba(255, 90, 94, 0.1);
  --ok: #8fe3a4;
  --ok-bg: rgba(110, 220, 140, 0.1);
  --warn: #ffc76b;
  --warn-bg: rgba(255, 177, 59, 0.1);
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 11, 10, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.02em; line-height: 1;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.brand small { display: block; margin-top: 4px; font-family: var(--font-body); font-weight: 500; font-size: 12px; letter-spacing: 0; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: filter .15s, transform .1s, background .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn:disabled { opacity: .7; cursor: progress; }

/* ---------- Page layout ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 36px 24px 72px; }
.greeting h1 {
  margin: 0 0 6px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 4.4vw, 56px); line-height: 1; letter-spacing: 0.005em;
}
.greeting p { margin: 0; color: var(--muted); max-width: 52ch; }

.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 36px; margin-top: 32px; align-items: start; }

/* ---------- Side navigation ---------- */
.nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; background: none; border: 0; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--muted); text-align: left; cursor: pointer;
  transition: color .15s, background .15s;
}
.nav button svg { width: 19px; height: 19px; flex: none; }
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Content blocks ---------- */
.pane { display: none; }
.pane.active { display: block; }
.block {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; margin-bottom: 20px;
}
.block h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; }
.block h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.lead { margin: 0 0 22px; color: var(--muted); font-size: 15px; max-width: 60ch; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.5;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(110, 220, 140, 0.3); }
.pill-warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(255, 177, 59, 0.3); }
.pill-bad { color: var(--danger); background: var(--danger-bg); border-color: rgba(255, 90, 94, 0.3); }

/* License cards */
.license {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; margin-bottom: 12px;
}
.license-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.key-row { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.key {
  flex: 1 1 260px; min-width: 0;
  display: flex; align-items: center;
  padding: 0 14px; height: 48px;
  background: var(--bg); border: 1px dashed rgba(216, 200, 74, 0.45); border-radius: 10px;
  font-family: var(--font-mono); font-size: 15.5px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--accent); overflow-x: auto; white-space: nowrap;
}
.license-meta { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.download {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 8px; padding: 18px; border-radius: 12px;
  background: rgba(216, 200, 74, 0.07); border: 1px solid rgba(216, 200, 74, 0.28);
}
.download p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }

.empty { color: var(--muted); font-size: 15px; padding: 6px 0; }
.empty a { color: var(--accent); text-underline-offset: 3px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.mono { font-family: var(--font-mono); font-size: 13.5px; }
td.strong { font-weight: 700; }
td.empty-cell { text-align: center; color: var(--muted); padding: 26px 16px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat span { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.stat b { font-family: var(--font-display); font-size: 38px; font-weight: 700; line-height: 1; }
.stat.main b { color: var(--accent); }
.rate { margin: 0 0 20px; font-size: 14.5px; color: var(--muted); }
.rate b { color: var(--text); }

/* Forms */
.field { margin-bottom: 18px; }
.field > label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; color: #d8d9d2; }
.input, textarea.input, select.input {
  width: 100%; height: 50px; padding: 0 14px;
  background: var(--field); border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.input { height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #666b65; }
.input:hover { border-color: rgba(255, 255, 255, 0.3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216, 200, 74, 0.18); background: #181b1a; }
.input[readonly] { color: var(--muted); font-family: var(--font-mono); font-size: 14.5px; }
.input-wrap { position: relative; }
.input.has-toggle { padding-right: 48px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.eye:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.eye svg { width: 20px; height: 20px; }
.eye .off { display: none; }
.eye[aria-pressed="true"] .on { display: none; }
.eye[aria-pressed="true"] .off { display: block; }
.hint { margin: 7px 0 0; font-size: 13.5px; color: var(--muted); }
.row { display: flex; gap: 8px; }
.row .input { flex: 1; min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.subpanel { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.narrow { max-width: 480px; }

/* Star rating */
.stars { display: inline-flex; gap: 4px; }
.stars button {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 10px; cursor: pointer; color: #4a4f49;
  transition: color .12s, background .12s;
}
.stars button svg { width: 28px; height: 28px; fill: currentColor; }
.stars button:hover { background: rgba(255, 255, 255, 0.06); }
.stars button.on { color: var(--accent); }
.star-label { margin-left: 10px; font-size: 14.5px; color: var(--muted); align-self: center; }
.rating-row { display: flex; align-items: center; flex-wrap: wrap; }

.note { margin-top: 14px; font-size: 14.5px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 18px;
  background: #1d201f; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 15px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .layout > * { min-width: 0; }
  .nav {
    position: static; flex-direction: row; gap: 6px; overflow-x: auto;
    padding-bottom: 6px; margin: 0 -24px; padding-inline: 24px; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { width: auto; flex: none; padding: 10px 14px; border: 1px solid var(--line); }
  .nav button[aria-selected="true"] { border-color: var(--accent); }
  .block { padding: 20px; }
}
@media (max-width: 560px) {
  .top-in, .page { padding-left: 16px; padding-right: 16px; }
  .nav { margin: 0 -16px; padding-inline: 16px; }
  .brand small, .user-chip .uname { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast, .btn, .input, .nav button { transition: none; }
}

/* never let the page grow wider than the screen */
html, body { max-width: 100%; overflow-x: hidden; }
.block { min-width: 0; }

.free-key { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.free-key-note { font-size: 13px; color: var(--muted); }
.free-key-help { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 12px; font-size: 14px; color: var(--muted); }
.free-key-help strong { color: var(--text, inherit); }
.free-key-help p { margin: 8px 0 0; line-height: 1.55; }
