:root { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  background: #0b0e14;
  color: #e6e6e6;
  line-height: 1.6;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  font-weight: 700;
  font-size: 1.2em;
  color: #f2f2f2;
  text-decoration: none;
}

.hero {
  text-align: center;
  padding: 40px 0 24px;
}

.hero h1 {
  font-size: 1.8em;
  margin-bottom: 8px;
}

.hero p {
  color: #9aa0a6;
}

.card {
  background: #131722;
  border: 1px solid #232838;
  border-radius: 14px;
  padding: 24px;
  margin: 20px 0;
}

.card > *:first-child { margin-top: 0; }
.card > *:last-child { margin-bottom: 0; }
.card > * + * { margin-top: 10px; }

.card h2 {
  font-size: 1.15em;
}

.btn {
  display: inline-block;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:hover { background: #2f6fdb; }
.btn:disabled { background: #364054; cursor: not-allowed; }

.btn-block { display: block; width: 100%; }

#trial-result {
  padding: 16px;
  border-radius: 10px;
  background: #0f1420;
  border: 1px solid #232838;
  display: none;
}

#trial-result a {
  word-break: break-all;
}

#trial-result.error { border-color: #7f1d1d; color: #fca5a5; }
#trial-result.ok { border-color: #14532d; }

.muted { color: #9aa0a6; font-size: 0.9em; }

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #232838;
  text-align: center;
}

footer a { color: #9aa0a6; margin: 0 10px; text-decoration: none; font-size: 0.9em; }
footer a:hover { color: #e6e6e6; }

a { color: #5aa9ff; }

.legal h1 { font-size: 1.5em; }
.legal h2 { font-size: 1.1em; margin-top: 28px; }
.legal .updated { color: #9aa0a6; font-size: 0.9em; margin-bottom: 24px; }
.legal ul { padding-left: 20px; }
.back { display: inline-block; margin-top: 24px; }

.tg-login-widget {
  display: flex;
  justify-content: center;
}

.profile-box {
  padding: 16px;
  border-radius: 10px;
  background: #0f1420;
  border: 1px solid #232838;
  display: none;
  text-align: left;
}

.profile-name {
  font-weight: 600;
  font-size: 1.05em;
  color: #f2f2f2;
  margin-bottom: 4px;
}

.profile-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #1c2130;
}

.profile-row:last-of-type {
  border-bottom: none;
}

.profile-row span {
  color: #9aa0a6;
  font-size: 0.9em;
}

.profile-row b {
  color: #f2f2f2;
  font-weight: 600;
  text-align: right;
}

.profile-cta {
  margin-top: 14px;
}

.profile-box.error {
  border-color: #7f1d1d;
  color: #fca5a5;
}

#chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
}

.chat-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #3b82f6;
  color: white;
  font-size: 1.4em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.chat-fab:hover { background: #2f6fdb; }

.chat-panel {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: min(340px, calc(100vw - 40px));
  height: min(460px, calc(100vh - 140px));
  background: #131722;
  border: 1px solid #232838;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.open { display: flex; }

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0f1420;
  border-bottom: 1px solid #232838;
  font-weight: 600;
}

.chat-close-btn {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 1.1em;
  cursor: pointer;
}
.chat-close-btn:hover { color: #e6e6e6; }

.chat-start-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-start-form input {
  background: #0f1420;
  border: 1px solid #232838;
  border-radius: 8px;
  color: #e6e6e6;
  padding: 10px 12px;
  font-size: 0.95em;
}

.chat-messages {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.chat-msg {
  max-width: 80%;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.92em;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-user {
  margin-left: auto;
  background: #3b82f6;
  color: white;
}

.chat-msg-admin {
  margin-right: auto;
  background: #0f1420;
  border: 1px solid #232838;
  color: #e6e6e6;
}

.chat-input-row {
  display: none;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #232838;
}

.chat-input-row input {
  flex: 1;
  background: #0f1420;
  border: 1px solid #232838;
  border-radius: 8px;
  color: #e6e6e6;
  padding: 10px 12px;
  font-size: 0.95em;
}

.chat-input-row .btn {
  padding: 10px 16px;
}
