@import url('https://fonts.googleapis.com/css2?family=Candal&family=Figtree:wght@400;500;600;700&display=swap');

:root {
  --ans-black: #000000;      --ans-soft-black: #2E2E2F;
  --ans-soft-gray: #E2E3E4;  --ans-white: #FFFFFF;
  --ans-crimson: #EF383A;    --ans-cyan: #00E7D0;
  --ans-text: #2E2E2F;       --ans-text-muted: #6B6B6C;
  --ans-bg: #FFFFFF;         --ans-bg-dark: #1A1A1B;
  --ans-bg-alt: #F7F7F8;     --ans-border: #E2E3E4;
}

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

body {
  font-family: 'Figtree', 'Proxima Nova', Arial, sans-serif;
  background-color: var(--ans-bg-dark);
  background-image: radial-gradient(circle, #3A3A3B 1px, transparent 1px);
  background-size: 16px 16px;
  color: var(--ans-text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ── Card ── */
.card {
  background: var(--ans-white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

/* ── Card header bar ── */
.card-header {
  background: var(--ans-soft-black);
  padding: 1.25rem 2rem;
  border-bottom: 3px solid var(--ans-crimson);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header .wordmark {
  font-family: 'Candal', Arial, sans-serif;
  font-size: 1.1rem;
  color: var(--ans-white);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-header .wordmark span {
  color: var(--ans-cyan);
}

/* ── Card body ── */
.card-body {
  padding: 1.75rem 2rem 2rem;
}

h1 {
  font-family: 'Candal', Arial, sans-serif;
  font-size: 1.75rem;
  color: var(--ans-soft-black);
  margin-bottom: 0.375rem;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--ans-text-muted);
  margin-bottom: 1.5rem;
}

/* ── Divider ── */
.ans-rule {
  height: 3px;
  background: var(--ans-crimson);
  border: none;
  border-radius: 2px;
  margin: 1.25rem 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  font-family: 'Figtree', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: filter 0.15s, transform 0.1s;
}

.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--ans-crimson);
  color: var(--ans-white);
}

.btn-save {
  background: var(--ans-crimson);
  color: var(--ans-white);
  width: 100%;
  margin-top: 1.5rem;
}

/* ── MCP list ── */
.mcp-list { list-style: none; }

.mcp-item {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--ans-border);
}

.mcp-item:last-child { border-bottom: none; }

.mcp-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ans-soft-black);
  text-transform: capitalize;
  margin-bottom: 0.1rem;
}

.mcp-desc {
  font-size: 0.8rem;
  color: var(--ans-text-muted);
}

/* ── Toggle switch ── */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--ans-soft-gray);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--ans-white);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider { background: var(--ans-crimson); }
input:checked + .slider::before { transform: translateX(20px); }

/* ── Status messages ── */
.status {
  margin-top: 1rem;
  padding: 0.65rem 0.875rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status.success {
  background: rgba(0, 231, 208, 0.12);
  color: #007a6e;
  border-left: 3px solid var(--ans-cyan);
}

.status.error {
  background: rgba(239, 56, 58, 0.08);
  color: var(--ans-crimson);
  border-left: 3px solid var(--ans-crimson);
}

/* ── Login copy ── */
.login-copy {
  font-size: 0.9rem;
  color: var(--ans-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ── Tool list (expandable) ── */
.mcp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tool-list { margin-top: 0.5rem; }

.tool-list-toggle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ans-crimson);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

.tool-list-toggle::-webkit-details-marker { display: none; }

.tool-list-toggle::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s;
  font-size: 0.7rem;
}

details[open] .tool-list-toggle::before { transform: rotate(90deg); }

.tool-chips {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tool-chip {
  display: flex;
  flex-direction: column;
  background: var(--ans-bg-alt);
  border-left: 2px solid var(--ans-crimson);
  border-radius: 0 6px 6px 0;
  padding: 0.3rem 0.6rem;
}

.tool-chip-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ans-black);
}

.tool-chip-desc {
  font-size: 0.72rem;
  color: var(--ans-text);
  margin-top: 0.05rem;
}

/* ── Logout button ── */
.btn-logout {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--ans-white);
  font-family: 'Figtree', Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-logout:hover { background: rgba(255,255,255,0.1); }

/* ── View switching ── */
#login-view, #dashboard-view { display: none; }
#login-view.active, #dashboard-view.active { display: block; }
