:root {
  --bg: #f3f5fb;
  --ink: #151824;
  --muted: #5d6478;
  --line: #d8dbe7;
  --card: #ffffff;
  --accent: #1f6fe5;
  --accent2: #0ea58a;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Text", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% -10%, #dce7ff 0, transparent 40%), var(--bg);
}

.portal {
  width: min(980px, 92vw);
  margin: 42px auto;
}

.hero {
  margin-bottom: 20px;
}

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3f68b8;
}

h1 {
  margin: 8px 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.04;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.lang-switch {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.lang-switch select {
  min-width: 138px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font: inherit;
}

.auth-panel {
  margin-bottom: 14px;
}

.auth-panel h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.auth-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.auth-mode-row {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-mode-row .auth-mode {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.auth-mode-row .auth-mode.active {
  background: #eaf2ff;
  border-color: #9eb9f2;
}

.auth-field {
  display: block;
  margin-bottom: 10px;
}

.auth-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font: inherit;
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.auth-terms input {
  margin-top: 2px;
}

.auth-terms-links {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.auth-terms-links a {
  color: #2f5fc6;
  text-decoration: none;
}

.auth-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.auth-code-row button,
.auth-action-row button,
.account-bar button {
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 38px;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-code-row button,
.auth-action-row button {
  background: #1f6fe5;
  color: #fff;
}

.auth-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-action-row .ghost {
  background: #fff;
  color: #2f3a54;
  border-color: var(--line);
}

.auth-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-status.error {
  color: #c23b2a;
}

.account-bar {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-bar button {
  background: #fff;
  color: #2f3a54;
  border-color: var(--line);
}

.terms-gate h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.terms-gate p {
  margin: 0 0 10px;
}

.terms-version {
  margin: 0 0 12px;
  font-size: 12px;
  color: #4e5c7d;
  font-weight: 700;
}

.terms-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.terms-confirm input {
  margin-top: 2px;
}

.terms-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.terms-actions button {
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  background: #1f6fe5;
  color: #fff;
  cursor: pointer;
}

.terms-actions a {
  color: #2f5fc6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  padding: 20px;
  box-shadow: 0 14px 40px rgba(17, 28, 62, 0.08);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.48;
}

.service-health {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}

.service-health.online { color: #0b8a5d; }
.service-health.offline { color: #c23b2a; }
.service-health.unknown { color: #6f778e; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 11px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(180deg, #2f80ff, #1868df);
}

.assistant .btn { background: linear-gradient(180deg, #1db69d, #0d947f); }
.knowledge-base .btn { background: linear-gradient(180deg, #8b5cf6, #6d3fe0); }
.btn.secondary { background: linear-gradient(180deg, #8b5cf6, #6d3fe0); }
.btn.disabled {
  background: #adb4c8;
  pointer-events: none;
}

.meta {
  display: none !important;
}

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