/* Atlas console — shared styles. Light theme, one accent color (#4f46e5). */

:root {
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --text: #111827;
  --muted: #6b7280;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --danger-text: #b91c1c;
  --danger-bg: #fdecec;
  --green-text: #15803d;
  --green-bg: #e9f7ef;
  --neutral-text: #4b5563;
  --neutral-bg: #f0f1f5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 12px 32px rgba(17, 24, 39, 0.07);
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

/* Layout */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-center {
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.page-content {
  width: 100%;
  max-width: 512px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* Card */

.card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

/* Typography */

.wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tagline {
  margin: 6px 0 26px;
  color: var(--muted);
}

.page-title {
  margin: 18px 0 6px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.plan-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.note {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* Forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.helper {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.form-error,
.form-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.875rem;
}

.form-error {
  color: var(--danger-text);
  background: var(--danger-bg);
}

.form-note {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:focus-visible,
.link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  color: #ffffff;
  background: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-block {
  width: 100%;
}

.btn-small {
  padding: 7px 12px;
  font-size: 0.85rem;
}

.link-button {
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  text-decoration: none;
}

.switch-line {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Dashboard */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-email {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--muted);
}

.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.assistant-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.divider {
  margin: 20px 0;
  border: none;
  border-top: 1px solid var(--border);
}

.instance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.instance-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  padding: 4px 8px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-all;
}

/* Status chip */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--neutral-text);
  background: var(--neutral-bg);
}

.chip-green {
  color: var(--green-text);
  background: var(--green-bg);
}

.chip-red {
  color: var(--danger-text);
  background: var(--danger-bg);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s ease-in-out infinite;
}

.chip .dot[hidden] {
  display: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot {
    animation: none;
  }
}

/* Responsive */

@media (max-width: 520px) {
  .card {
    padding: 24px 20px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .user-email {
    max-width: 150px;
  }
}
