/* ---------------------------------------------------------------------------
   CrackThatOffer — shared design system
--------------------------------------------------------------------------- */

:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --border: #e4e7f0;
  --border-strong: #d2d7e6;
  --ink: #0f1734;
  --ink-2: #4a5578;
  --ink-3: #7b86a8;
  --brand: #2f4bff;
  --brand-dark: #1d34d6;
  --brand-soft: #eef1ff;
  --green: #0f9d58;
  --green-soft: #e6f6ed;
  --amber: #b26a00;
  --amber-soft: #fdf1dc;
  --red: #d93025;
  --red-soft: #fdecea;
  --purple: #7c3aed;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 64, 0.06), 0 8px 24px rgba(16, 24, 64, 0.06);
  --shadow-lg: 0 4px 12px rgba(16, 24, 64, 0.08), 0 20px 48px rgba(16, 24, 64, 0.12);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---- layout --------------------------------------------------------------- */

.shell { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.shell-wide { max-width: 1480px; margin: 0 auto; padding: 0 20px; }

/* ---- top nav -------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.logo-mark {
  font-family: var(--mono);
  color: var(--brand);
  font-size: 19px;
  font-weight: 700;
}

.nav-links { display: flex; gap: 22px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.nav-links a:hover { color: var(--brand); }
.nav-links a.active { color: var(--brand); }
.nav-spacer { flex: 1; }

.nav-right { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  color: #fff;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.03em;
}

/* ---- footer --------------------------------------------------------------- */

.site-footer {
  margin-top: 72px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 36px;
  padding: 48px 0 36px;
}

.footer-brand .logo { color: var(--ink); }
.footer-brand p { margin: 14px 0 0; max-width: 300px; color: var(--ink-3); line-height: 1.6; }

.footer-col h4 {
  margin: 4px 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a:hover,
.footer-bottom a:hover { color: var(--brand); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.footer-bottom a { color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 17px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.08s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #b9c2e8; cursor: not-allowed; }

.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-outline { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(0.94); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---- badges --------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-easy   { background: var(--green-soft); color: var(--green); }
.badge-medium { background: var(--amber-soft); color: var(--amber); }
.badge-hard   { background: var(--red-soft);   color: var(--red); }
.badge-brand  { background: var(--brand-soft); color: var(--brand); }
.badge-trend  { background: #fff1e3; color: #c2410c; }
.badge-fresh  { background: var(--green-soft); color: var(--green); }
.badge-solved { background: var(--green); color: #fff; }
.badge-attempted { background: var(--amber-soft); color: var(--amber); }
.badge-muted  { background: #eef0f6; color: var(--ink-3); }

/* ---- cards ---------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- progress ------------------------------------------------------------- */

.bar {
  height: 7px;
  border-radius: 999px;
  background: #e9ecf5;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #34c77b);
  transition: width 0.4s ease;
}

.ring { --pct: 0; width: 44px; height: 44px; position: relative; }
.ring::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), #e9ecf5 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 66%, #000 68%);
  mask: radial-gradient(farthest-side, transparent 66%, #000 68%);
}
.ring > span {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--ink-2);
}

/* ---- forms ---------------------------------------------------------------- */

.field { display: block; margin-bottom: 15px; }
.field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font: inherit;
  font-size: 14.5px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.14s, box-shadow 0.14s;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 75, 255, 0.14);
}

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
}
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-info  { background: var(--brand-soft); color: var(--brand); }

/* ---- misc ----------------------------------------------------------------- */

.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
  padding: 16px 0;
}
.back-link:hover { color: var(--brand); }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #eef0f6 25%, #f6f7fb 50%, #eef0f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
