:root {
  --background: #f5efe6;
  --surface: rgba(255, 252, 246, 0.84);
  --surface-strong: #fffaf2;
  --text: #20170f;
  --muted: #6d5d4f;
  --accent: #a04ee6;
  --accent-strong: #7d2dd0;
  --border: rgba(32, 23, 15, 0.08);
  --shadow: 0 24px 60px rgba(65, 38, 17, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(160, 78, 230, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 177, 66, 0.24), transparent 32%),
    var(--background);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header,
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.24rem;
}

.brand-large {
  font-size: 2rem;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-weight: 500;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.5);
}

.hero-layout,
.dashboard-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 40px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 108px);
}

.hero-copy,
.hero-card,
.dashboard-card,
.auth-panel {
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.hero-copy {
  padding: 48px;
}

.eyebrow {
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 5.2rem);
}

h2 {
  font-size: 1.8rem;
}

.hero-text,
.form-intro,
.auth-panel-brand p,
.dashboard-card p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin: 30px 0;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(32, 23, 15, 0.08);
}

.button-full {
  width: 100%;
}

.feature-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.feature-list li {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  color: var(--muted);
}

.hero-card {
  padding: 24px;
}

.hero-image,
.auth-image {
  width: 100%;
  height: auto;
}

.auth-page,
.dashboard-page {
  display: grid;
  min-height: 100vh;
}

.auth-shell {
  width: min(1100px, calc(100% - 32px));
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 24px;
  padding: 24px 0;
}

.auth-panel {
  padding: 40px;
}

.auth-panel-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  border: 1px solid rgba(32, 23, 15, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
}

.auth-form input:focus {
  outline: 2px solid rgba(160, 78, 230, 0.25);
  border-color: var(--accent);
}

.form-note {
  margin: 0;
  color: var(--muted);
}

.form-note a {
  color: var(--accent-strong);
  font-weight: 600;
}

.alert {
  margin: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 500;
}

.alert p {
  margin: 0;
}

.alert p + p {
  margin-top: 8px;
}

.alert-error {
  background: rgba(188, 35, 35, 0.12);
  border: 1px solid rgba(188, 35, 35, 0.26);
  color: #7c1f1f;
}

.alert-success {
  background: rgba(26, 130, 76, 0.12);
  border: 1px solid rgba(26, 130, 76, 0.26);
  color: #175e39;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 40px;
}

.dashboard-hero {
  grid-column: 1 / -1;
  padding: 40px;
}

.dashboard-card {
  padding: 32px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 0;
}

.info-grid div {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.info-grid dt,
.stats-grid span {
  color: var(--muted);
}

.info-grid dd {
  margin: 8px 0 0;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.stats-grid article {
  padding: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.48);
}

.stats-grid strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

.dashboard-table-card {
  grid-column: 1 / -1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(32, 23, 15, 0.12);
}

.admin-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: var(--muted);
}

.chat-layout {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto 40px;
}

.chat-shell {
  padding: 24px;
}

.chat-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.chat-control-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(32, 23, 15, 0.08);
}

.chat-control-group label {
  font-weight: 600;
}

.chat-control-group select,
.chat-moderation-form select,
.chat-moderation-form input {
  width: 100%;
  border: 1px solid rgba(32, 23, 15, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
}

.chat-refresh-note {
  align-content: center;
  color: var(--muted);
  font-weight: 500;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.chat-user {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.chat-stream {
  display: grid;
  gap: 12px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(32, 23, 15, 0.08);
  background: rgba(255, 255, 255, 0.52);
}

.chat-empty {
  margin: 6px;
  color: var(--muted);
}

.chat-message {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(32, 23, 15, 0.08);
}

.chat-message-mine {
  border-color: rgba(125, 45, 208, 0.25);
  background: rgba(250, 243, 255, 0.9);
}

.chat-message header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.chat-message time {
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-message p {
  margin: 0;
  white-space: normal;
  line-height: 1.5;
}

.message-actions {
  display: flex;
  justify-content: end;
  margin-top: 10px;
}

.message-delete {
  border: 1px solid rgba(188, 35, 35, 0.3);
  border-radius: 999px;
  background: rgba(188, 35, 35, 0.12);
  color: #7c1f1f;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}

.message-delete:hover,
.message-delete:focus-visible {
  background: rgba(188, 35, 35, 0.2);
}

.chat-form {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.chat-form label {
  font-weight: 600;
}

.chat-form textarea {
  width: 100%;
  border: 1px solid rgba(32, 23, 15, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  resize: vertical;
}

.chat-form textarea:focus {
  outline: 2px solid rgba(160, 78, 230, 0.25);
  border-color: var(--accent);
}

.chat-moderation {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(32, 23, 15, 0.1);
}

.chat-moderation h2 {
  margin-bottom: 12px;
}

.chat-moderation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chat-moderation-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(32, 23, 15, 0.08);
}

.chat-moderation-form label {
  font-weight: 600;
}

@media (max-width: 900px) {
  .hero-layout,
  .auth-shell,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .site-header,
  .dashboard-header {
    padding: 20px;
    gap: 18px;
    flex-direction: column;
  }

  .hero-copy,
  .hero-card,
  .auth-panel,
  .dashboard-card,
  .dashboard-hero {
    padding: 24px;
  }

  .stats-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .chat-header {
    flex-direction: column;
    align-items: start;
  }

  .chat-controls,
  .chat-moderation-grid {
    grid-template-columns: 1fr;
  }
}