/* ==========================================================================
   Solvino Admin — shared design system
   Used by: Pages/Index.cshtml, Pages/Puzzles/Manage.cshtml,
            Areas/Identity/Pages/Account/Login.cshtml + Register.cshtml
   Keep page-specific <style> blocks minimal — anything reusable belongs here.
   ========================================================================== */

:root {
  --bg: #0a0b12;
  --surface: #12141f;
  --surface-2: #181b29;
  --surface-3: #1f2333;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --ink: #eef0f8;
  --muted: #8891ab;
  --muted-2: #5f6786;

  --accent: #7c6fff;
  --accent-2: #00d4aa;
  --accent-grad: linear-gradient(135deg, #8b7cff 0%, #6a5cf0 45%, #00d4aa 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(139, 124, 255, .16), rgba(0, 212, 170, .12));

  --danger: #ff5577;
  --danger-soft: rgba(255, 85, 119, .14);
  --warning: #f5a623;
  --warning-soft: rgba(245, 166, 35, .14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, .14);

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .22);
  --shadow: 0 16px 40px rgba(0, 0, 0, .38);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
dialog {
  margin: auto !important;
}
dialog:modal,
dialog[open] {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  margin: auto !important;
}

html { scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; }
::-webkit-scrollbar-track { background: transparent; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Soft ambient glow behind everything — fixed so it doesn't scroll/repeat. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(680px circle at 12% -8%, rgba(124, 111, 255, .16), transparent 55%),
    radial-gradient(560px circle at 100% 8%, rgba(0, 212, 170, .12), transparent 50%),
    radial-gradient(900px circle at 50% 115%, rgba(124, 111, 255, .08), transparent 60%);
  pointer-events: none;
}

a { color: inherit; }

/* ---------- Topbar / brand ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 18, .78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(124, 111, 255, .35);
  flex-shrink: 0;
}
img.brand-icon { display: block; object-fit: cover; background: none; }
.brand-title {
  font-size: 1.08rem; font-weight: 800; letter-spacing: -0.01em;
  background: linear-gradient(90deg, #fff 45%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: .74rem; color: var(--muted); margin-top: 1px; }

/* ---------- Buttons ---------- */

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: .85rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.1;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, border-color .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--border-strong); background: var(--surface-3); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(124, 111, 255, .3);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(124, 111, 255, .42); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-success {
  background: linear-gradient(135deg, var(--accent-2), #00b894);
  color: #06251d;
  box-shadow: 0 8px 22px rgba(0, 212, 170, .25);
}
.btn-success:hover { box-shadow: 0 10px 28px rgba(0, 212, 170, .35); }

.btn-danger {
  background: var(--danger-soft);
  color: #ffb0c2;
  border-color: rgba(255, 85, 119, .3);
}
.btn-danger:hover { background: rgba(255, 85, 119, .22); border-color: rgba(255, 85, 119, .5); color: #fff; }

.btn-regen {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--border);
}
.btn-regen:hover { border-color: var(--accent); color: #cfc9ff; }

.btn-block { width: 100%; padding: 12px; font-size: .95rem; }

/* ---------- Cards ---------- */

.card {
  background: linear-gradient(180deg, var(--surface), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card.hoverable:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .01em;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-easy { background: var(--success-soft); color: #4ade80; }
.badge-medium { background: var(--warning-soft); color: #fbbf24; }
.badge-hard { background: var(--danger-soft); color: #ff7a95; }
.badge-info { background: var(--surface-3); color: var(--muted); }

/* ---------- Toast ---------- */

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--success-soft);
  border: 1px solid rgba(34, 197, 94, .3);
  color: #7cf0a8;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .88rem;
  font-weight: 550;
  margin-bottom: 18px;
  animation: toast-in .25s ease;
}
.toast-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34, 197, 94, .22);
  font-size: .78rem;
}
.toast-error {
  background: var(--danger-soft);
  border-color: rgba(255, 85, 119, .32);
  color: #ffb0c2;
}
.toast-error .toast-icon { background: rgba(255, 85, 119, .22); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Form fields ---------- */

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: .78rem; font-weight: 650;
  color: var(--muted); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: .92rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { resize: vertical; font-family: inherit; box-sizing: border-box; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 111, 255, .18);
  background: var(--surface-3);
}
.field-error { color: #ff7a95; font-size: .76rem; margin-top: 5px; }
.field-hint { color: var(--muted); font-size: .74rem; margin-top: 5px; }
.field-optional { font-weight: 500; text-transform: none; letter-spacing: 0; }

.alert {
  background: var(--danger-soft);
  border: 1px solid rgba(255, 85, 119, .3);
  color: #ffb0c2;
  border-radius: var(--radius);
  padding: 12px 15px;
  margin-bottom: 18px;
  font-size: .85rem;
}

/* ---------- Empty state ---------- */

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
  opacity: .8;
}

/* ---------- Misc utility ---------- */

.pill-stat {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px; font-size: .78rem; color: var(--muted);
  font-weight: 600;
}
.pill-stat strong { color: var(--ink); font-weight: 750; }

.divider { text-align: center; margin: 20px 0 16px; font-size: .8rem; color: var(--muted-2); }
.link-row { text-align: center; font-size: .85rem; color: var(--muted); }
.link-row a { color: var(--accent-2); text-decoration: none; font-weight: 650; }
.link-row a:hover { text-decoration: underline; }
