:root {
  --bg: #f6f8ff;
  --card: #ffffff;
  --text: #07142f;
  --muted: #63718d;
  --line: #dde6f7;
  --line-strong: #c4d1ea;
  --night: #07142f;
  --night-2: #0d2356;
  --brand-blue: #2f82ff;
  --brand-purple: #7557f4;
  --green: #07142f;
  --green-soft: #eef4ff;
  --green-text: #2856b5;
  --amber-soft: #fff4d8;
  --amber-text: #986700;
  --red-soft: #fde8e8;
  --red-text: #a62929;
  --shadow: 0 18px 45px rgba(7, 20, 47, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #f9fbff 0%, var(--bg) 50%, #f8f9fe 100%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans SC",
    "PingFang SC",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(124, 157, 244, 0.35);
  border-radius: 8px;
  background: var(--night);
  box-shadow: 0 10px 28px rgba(13, 35, 86, 0.16);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

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

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.language-switch {
  display: inline-flex;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.language-switch button {
  width: auto;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.active {
  background: linear-gradient(135deg, var(--night-2), var(--brand-purple));
  color: #fff;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 560px;
  margin: 32px auto 0;
  padding: 28px;
}

.section {
  padding: 22px;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: 0;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 7px;
}

.form-row label {
  color: #31372f;
  font-size: 13px;
  font-weight: 700;
}

.field {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(47, 130, 255, 0.16);
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  background: #e8eefb;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, var(--night-2), var(--brand-blue) 58%, var(--brand-purple));
  color: #fff;
}

.button.ghost {
  border-color: var(--line-strong);
  background: #fff;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.notice {
  display: none;
  margin: 0 0 14px;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 700;
}

.notice.show {
  display: block;
}

.notice.error {
  background: var(--red-soft);
  color: var(--red-text);
}

.notice.success {
  background: var(--green-soft);
  color: var(--green-text);
}

.hidden {
  display: none !important;
}

.captcha-row {
  min-height: 86px;
}

.captcha-widget {
  min-height: 65px;
}

.captcha-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.terms-acceptance {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.terms-acceptance input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--brand-blue);
}

.terms-acceptance a {
  font-weight: 900;
}

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

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-value {
  margin-top: 7px;
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--amber-soft);
  color: var(--amber-text);
  font-size: 13px;
  font-weight: 800;
}

.badge.good {
  background: var(--green-soft);
  color: var(--green-text);
}

.badge.bad {
  background: var(--red-soft);
  color: var(--red-text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #34415c;
  background: #f3f6ff;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
}

.loading {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.legal-footer {
  display: grid;
  gap: 7px;
  margin: 26px auto 0;
  max-width: 920px;
  text-align: center;
}

.legal-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 850;
}

.legal-footer p:last-child {
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 860px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100vw - 20px, 1160px);
    padding-top: 18px;
  }

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

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .language-switch {
    width: 100%;
  }

  .language-switch button {
    flex: 1;
  }

  .auth-card,
  .section {
    padding: 18px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
