:root {
  --bg: #0b0f17;
  --panel: #0f1520;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #8b5cf6;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 720px;
  --radius: 14px;
  --shadow: 0 14px 50px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
}

.notice {
  width: min(100%, var(--max-width));
  background: linear-gradient(145deg, rgba(15, 21, 32, 0.9), rgba(15, 21, 32, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 48px);
  box-shadow: var(--shadow);
  position: relative;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  color: #d8b4fe;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(139, 92, 246, 0.3);
  margin-bottom: 16px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #d8b4fe, #8b5cf6 60%);
  box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.12);
}

.status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 4vw, 2.9rem);
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
}

.secondary {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.2);
  color: #d8b4fe;
}

.login-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 14, 0.75);
  backdrop-filter: blur(8px);
  padding: 24px;
  z-index: 10;
}

.auth-overlay.is-open {
  display: flex;
}

.auth-modal {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
}

.auth-modal h2 {
  margin: 0 0 8px;
}

.auth-modal p {
  color: var(--muted);
  margin: 0 0 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

.auth-form input[type='email'] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
}

.auth-form input[type='password'],
.auth-form input[type='text'] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
}

.auth-form input[type='email']::placeholder {
  color: #777f8d;
}

.auth-form input[type='password']::placeholder,
.auth-form input[type='text']::placeholder {
  color: #777f8d;
}

.primary-button {
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(120deg, #8b5cf6, #6366f1);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
}

.muted-button {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.auth-result {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text);
  word-break: break-word;
}

.auth-result.is-visible {
  display: block;
}

.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tiny {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 6px 0 0;
}

.pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-alt {
  align-items: flex-start;
}

.auth-grid {
  width: min(100%, 900px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 21, 32, 0.9);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 6px;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  display: none;
}

.message.is-visible {
  display: block;
}

.message.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #bbf7d0;
}

.message.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

.status-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}

.tools-wrap {
  width: min(100%, var(--max-width));
  background: linear-gradient(160deg, rgba(15, 21, 32, 0.96), rgba(15, 21, 32, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(30px, 5vw, 44px);
  box-shadow: var(--shadow);
}

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

.badge-row h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.user-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: #e9d5ff;
  border: 1px solid rgba(139, 92, 246, 0.5);
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.tool-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
}

.tool-card h3 {
  margin: 0 0 6px;
}

.locked {
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  padding: 18px;
  border-radius: 12px;
  margin-top: 10px;
}

@media (max-width: 540px) {
  .page {
    align-items: flex-start;
    padding: 32px 16px;
  }

  .notice {
    padding: 28px 22px;
  }

  .topbar {
    justify-content: center;
    margin-bottom: 22px;
  }
}
