@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg0: #06060a;
  --bg1: #0c0c14;
  --card: rgba(22, 22, 32, 0.72);
  --card-solid: #12121c;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f8;
  --muted: #8b8ba3;
  --accent: #7c5cff;
  --accent2: #00d4aa;
  --tg: #2aabee;
  --dc: #5865f2;
  --ok: #3dd68c;
  --err: #ff6b8a;
  --warn: #ffb347;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg0);
  color: var(--text);
  line-height: 1.5;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(124, 92, 255, 0.35), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(0, 212, 170, 0.2), transparent),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(88, 101, 242, 0.15), transparent),
    var(--bg0);
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* Topbar */
.app-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.app-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.app-brand-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-brand-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.app-nav {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.app-nav a {
  padding: 0.5rem 1rem;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.app-nav a:hover {
  color: var(--text);
}

.app-nav a.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(0, 212, 170, 0.15));
}

/* Cards */
.ui-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: calc(var(--radius) + 2px);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 1.35rem 1.5rem;
}

.ui-card-title {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.ui-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Form */
.ui-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.ui-field > span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ui-field input,
.ui-field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ui-field input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.ui-field input[type="file"] {
  padding: 0.55rem;
  font-size: 0.82rem;
}

.ui-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Buttons */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
}

.ui-btn:active {
  transform: scale(0.98);
}

.ui-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #5b3fd4);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124, 92, 255, 0.4);
}

.ui-btn-primary:hover {
  box-shadow: 0 6px 32px rgba(124, 92, 255, 0.5);
}

.ui-btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--card-border);
}

.ui-btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Alert / toast */
.ui-alert {
  position: relative;
  z-index: 2;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.ui-alert-warn {
  background: rgba(255, 179, 71, 0.1);
  border: 1px solid rgba(255, 179, 71, 0.3);
  color: #ffd9a0;
}

.ui-alert a {
  color: var(--accent2);
}

.ui-alert code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.ui-toast {
  margin: 0.75rem 0 0;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.ui-toast-ok {
  background: rgba(61, 214, 140, 0.12);
  color: var(--ok);
  border: 1px solid rgba(61, 214, 140, 0.25);
}

.ui-toast-error {
  background: rgba(255, 107, 138, 0.12);
  color: var(--err);
  border: 1px solid rgba(255, 107, 138, 0.25);
}
