:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #121933;
  --panel: rgba(12, 18, 38, 0.88);
  --panel-border: rgba(148, 163, 184, 0.16);
  --text: #e5ecff;
  --muted: #93a4c7;
  --primary: #6d7cff;
  --primary-hover: #8390ff;
  --success: #1f9d68;
  --error: #d05b73;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(109, 124, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #0a0f1f 0%, #070b16 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-body,
.page-shell {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
}

.auth-card h1,
.topbar h1,
.panel-header h2 {
  margin: 0;
}

.auth-subtitle,
.page-subtitle,
.panel-header p,
.timeline-meta time,
.empty-state {
  color: var(--muted);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(109, 124, 255, 0.14);
  border: 1px solid rgba(109, 124, 255, 0.3);
  font-size: 13px;
  margin-bottom: 16px;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel-header {
  margin-bottom: 20px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(109, 124, 255, 0.9);
}

textarea {
  resize: vertical;
  min-height: 136px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
}

.button-secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.button-link {
  padding: 10px 14px;
  background: rgba(109, 124, 255, 0.12);
  color: #cbd5ff;
}

.button-full {
  width: 100%;
}

.alert {
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(208, 91, 115, 0.14);
  color: #ffc2cf;
  border-color: rgba(208, 91, 115, 0.3);
}

.alert-success {
  background: rgba(31, 157, 104, 0.14);
  color: #c2ffe4;
  border-color: rgba(31, 157, 104, 0.3);
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-card {
  position: relative;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(10, 15, 31, 0.8);
}

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

.timeline-author {
  font-weight: 600;
}

.timeline-text {
  margin: 0 0 16px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.timeline-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.file-name {
  color: #c9d6f5;
  word-break: break-word;
}

.empty-state {
  padding: 24px;
  text-align: center;
  border-radius: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
}

@media (max-width: 920px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .panel,
  .auth-card {
    padding: 20px;
    border-radius: 20px;
  }

  .timeline-meta,
  .timeline-file {
    flex-direction: column;
    align-items: flex-start;
  }

  .button-secondary,
  .button-link {
    width: 100%;
  }
}
