/* Cal — application styles */

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

:root {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-border: #2a2d3a;
  --color-text: #e8eaf0;
  --color-text-muted: #8b8fa8;
  --color-accent: #6366f1;
  --color-accent-hover: #4f52d6;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Utilities ─────────────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ── Login overlay ─────────────────────────────────────────────────────── */

#login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  z-index: 100;
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  text-align: center;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-header p {
  color: var(--color-text-muted);
  margin-top: 6px;
  font-size: 13px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  width: 100%;
}

.btn-google {
  background: #fff;
  color: #1f1f1f;
}

.btn-google:hover {
  background: #f5f5f5;
}

.btn-google svg {
  flex-shrink: 0;
}

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

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

.btn-secondary {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  font-size: 13px;
  padding: 8px 12px;
}

.btn-secondary:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

/* ── Divider ───────────────────────────────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ── Magic link form ───────────────────────────────────────────────────── */

.magic-link-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.magic-link-form input {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}

.magic-link-form input:focus {
  border-color: var(--color-accent);
}

.magic-link-form input::placeholder {
  color: var(--color-text-muted);
}

/* ── Status messages ───────────────────────────────────────────────────── */

.login-status {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  min-height: 20px;
}

.login-status.error {
  color: var(--color-error);
}

.login-status.success {
  color: var(--color-success);
}

/* ── User badge (top bar) ──────────────────────────────────────────────── */

#user-badge {
  position: fixed;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 6px 12px 6px 8px;
  font-size: 13px;
  z-index: 50;
}

#user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

#user-email {
  color: var(--color-text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-role {
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── App shell ─────────────────────────────────────────────────────────── */

#app {
  padding: 80px 24px 24px;
  max-width: 960px;
  margin: 0 auto;
}

#app h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

#app p {
  color: var(--color-text-muted);
}
