/* Parallex status portal — dark, calm, mobile-first. No framework. */

:root {
  --bg: #0a0a0d;
  --bg-elevated: #131317;
  --bg-elevated-2: #1a1a20;
  --border: #232329;
  --text: #e8e8ec;
  --text-muted: #9898a3;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, p, ul { margin: 0; }

.muted { color: var(--text-muted); }

/* ---------- Login page ---------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

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

.field label {
  font-size: 13px;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 16px; /* prevents iOS auto-zoom on focus */
  width: 100%;
}

input[type="text"]:focus-visible,
input[type="password"]:focus-visible {
  border-color: var(--accent);
}

.login-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover { text-decoration: underline; }

/* ---------- App shell ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.topbar .wordmark { margin-bottom: 0; }

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  font-size: 13px;
  min-width: 0;
}

#user-display {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.project-switcher { padding: 12px 16px 0; }

.project-select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
}

.project-tabs { display: none; }

main {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.loading-state {
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
  text-align: center;
}

.error-banner {
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ---------- Board ---------- */

.board {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 8px 0 32px;
}

.column h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 10px;
}

.column-primary h2 { color: var(--accent); }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.column-primary .task-card {
  border-color: var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated-2);
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.chip {
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.task-body {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 10px 0;
}

/* ---------- Updates ---------- */

.updates-section {
  margin-bottom: 40px;
}

.updates-section h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

.updates-list {
  list-style: none;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.update-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.update-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.update-date {
  font-size: 12px;
  color: var(--text-muted);
}

.update-caption {
  font-size: 14px;
  color: var(--text);
}

/* ---------- Mail panel ---------- */

.mail-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin-bottom: 40px;
}

.mail-panel summary {
  cursor: pointer;
  padding: 13px 0;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}

.mail-panel summary::-webkit-details-marker { display: none; }
.mail-panel summary::before { content: "\25B8  "; color: var(--text-muted); }
.mail-panel[open] summary::before { content: "\25BE  "; }

.mail-content {
  padding: 4px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.mail-label {
  width: 84px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mail-value {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.mail-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

/* ---------- Desktop ---------- */

@media (min-width: 768px) {
  main { padding: 24px 32px; }

  .project-select { display: none; }

  .project-tabs {
    display: flex;
    gap: 4px;
    width: fit-content;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
  }

  .project-switcher { padding: 16px 32px 0; max-width: 1100px; margin: 0 auto; }

  .tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 14px;
    cursor: pointer;
  }

  .tab-btn.active { background: var(--accent); color: #fff; }
  .tab-btn:hover:not(.active) { color: var(--text); }

  .board {
    flex-direction: row;
    align-items: flex-start;
  }

  .column {
    flex: 1;
    min-width: 0;
  }

  .column-primary { flex: 1.3; }
}
