:root {
  --bg: #070b18;
  --panel: rgba(16, 24, 48, 0.6);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e6ecff;
  --muted: #b8c3e8;
  --primary: #48a3ff;
  --warn: #f59e0b;
  --ok: #22c55e;
  --err: #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  background: radial-gradient(1200px 700px at 20% 10%, #13214e, transparent), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.bg-aurora {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(500px 300px at 90% 20%, rgba(72, 163, 255, 0.2), transparent),
    radial-gradient(500px 300px at 20% 80%, rgba(167, 139, 250, 0.2), transparent);
  pointer-events: none;
}

.glass {
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.topbar {
  margin: 18px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-left h1 {
  margin: 0;
  font-size: 1.1rem;
}

.top-left p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
}

.chip {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.layout {
  margin: 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  padding: 16px;
}

h2, h3 {
  margin-top: 0;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.switch-row {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.beautiful-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.beautiful-switch .slider {
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  position: relative;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.beautiful-switch .slider::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  right: 2px;
  transition: all 0.2s ease;
}

.beautiful-switch input[type="checkbox"]:checked + .slider {
  background: linear-gradient(90deg, #2563eb, #22d3ee);
}

.beautiful-switch input[type="checkbox"]:checked + .slider::after {
  right: 24px;
}

textarea, input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
}

textarea { resize: vertical; }

.action-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary { background: linear-gradient(90deg, #2f7fe8, #49a5ff); }
.btn.warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.btn.ghost { background: rgba(255, 255, 255, 0.08); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.muted { color: var(--muted); }
.hint { color: #94a3b8; font-size: 0.85rem; }

.status {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}
.status.ok { border: 1px solid rgba(34, 197, 94, 0.4); }
.status.warn { border: 1px solid rgba(245, 158, 11, 0.4); }
.status.error { border: 1px solid rgba(239, 68, 68, 0.45); }

.results-wrap {
  margin: 16px 18px 20px;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
  width: 100%;
}

.result-card.fail {
  border-color: rgba(245, 158, 11, 0.65);
}

.row {
  margin-bottom: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(56, 189, 248, 0.18);
  color: #dbeafe;
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.78rem;
}

.copy-btn:hover {
  background: rgba(59, 130, 246, 0.32);
}

.copy-btn.config-btn {
  background: rgba(167, 139, 250, 0.2);
}

code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px 7px;
}

.source-row {
  margin-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  padding-top: 8px;
}

.source-title {
  font-size: 0.8rem;
  color: #9fb7ff;
  margin-bottom: 6px;
}

.source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 0.9rem;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 16px;
}

.login-card {
  width: min(460px, 100%);
  padding: 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-row h1 {
  margin: 0;
  font-size: 1.2rem;
}

.login-form {
  display: grid;
  gap: 8px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 10px;
  padding: 8px;
  margin: 10px 0;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
