:root {
  --bg: #0b0d10;
  --surface: #14181e;
  --ink: #e8eaed;
  --muted: #9aa3af;
  --line: #262b33;
  --accent: #5b9cff;
  --font: "Manrope", "Segoe UI", sans-serif;
  --container: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.92);
}

.header-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  min-height: 2rem;
  min-width: 2.4rem;
  border-radius: 999px;
  cursor: pointer;
}

.lang-switch button.is-active {
  background: #1c2430;
  color: var(--ink);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 1rem 0 0;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.tab-btn.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.tab-btn:hover {
  color: var(--ink);
}

main {
  flex: 1;
  padding: 0 0 3rem;
}

.panel {
  display: none;
  padding: 2rem 0 0;
  min-height: 40vh;
}

.panel.is-active {
  display: block;
}

.panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.panel p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.panel > p {
  margin-bottom: 1.35rem;
}

.info-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.25rem;
}

@media (min-width: 800px) {
  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

.info-card,
.info-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.15rem 1.2rem;
}

.info-card h2,
.info-block h2 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.info-card p,
.info-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: none;
}

.info-block {
  margin-top: 0.85rem;
}

.info-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.info-list li {
  position: relative;
  padding-left: 0.95rem;
}

.info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Account auth — centered */
.panel-account {
  min-height: 58vh;
}

.auth-stage {
  display: grid;
  place-items: center;
  padding: 1.5rem 0 2rem;
}

.auth-card {
  width: min(100%, 420px);
  background: linear-gradient(180deg, #171c24 0%, #12161c 100%);
  border: 1px solid #2a313c;
  border-radius: 16px;
  padding: 1.6rem 1.5rem 1.45rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.auth-card-brand img {
  border-radius: 10px;
}

.auth-card-brand strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.auth-card-brand span {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  text-align: center;
}

.auth-lead {
  margin: 0 0 1.15rem !important;
  text-align: center;
  max-width: none !important;
  font-size: 0.92rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin-bottom: 1.15rem;
  padding: 0.28rem;
  background: #0b0d10;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.auth-tab {
  border: 0;
  background: transparent;
  min-height: 2.45rem;
  border-radius: 9px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.is-active {
  background: #1c2430;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #314055;
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #323a46;
  border-radius: 10px;
  background: #0d1015;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.auth-form input::placeholder {
  color: #66707f;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 156, 255, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #081018;
  font-weight: 750;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: #3a4352;
  filter: none;
  background: rgba(255, 255, 255, 0.03);
}

.auth-error {
  margin: 0.35rem 0 0;
  color: #ff8e8e;
  font-size: 0.88rem;
  text-align: center;
}

.hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  max-width: none;
}

.hint.center {
  text-align: center;
}

/* Portal */
.portal-stage {
  padding: 0.5rem 0 1rem;
}

.portal-shell {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .portal-shell {
    grid-template-columns: 250px 1fr;
    gap: 1.25rem;
    align-items: start;
  }
}

.portal-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  display: grid;
  gap: 1rem;
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.portal-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(91, 156, 255, 0.16);
  color: var(--accent);
  font-weight: 800;
  flex: 0 0 auto;
}

.portal-user strong {
  display: block;
  font-size: 0.98rem;
}

.portal-user span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  word-break: break-all;
}

.portal-nav {
  display: grid;
  gap: 0.25rem;
}

.portal-link {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

.portal-link:hover,
.portal-link.is-active {
  color: var(--ink);
  background: #1c2430;
}

.portal-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.35rem 1.3rem;
  min-height: 320px;
}

.portal-view {
  display: none;
}

.portal-view.is-active {
  display: block;
}

.portal-view h1 {
  margin-bottom: 0.4rem;
}

.portal-view > p {
  margin-bottom: 1.15rem;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10141a;
}

.download-row strong {
  display: block;
  margin-bottom: 0.15rem;
}

.download-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.account-grid {
  display: grid;
  gap: 1.75rem;
  padding: 1.5rem 0 2.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .account-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.25rem;
  }
}

.account-points {
  margin: 1.1rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
}

.portal-cards {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.15rem;
}

.portal-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10141a;
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.2rem;
}

.portal-card small {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.portal-card strong {
  font-size: 1.15rem;
}

.portal-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.portal-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10141a;
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.portal-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.portal-panel label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.portal-panel input,
.portal-panel textarea,
.portal-panel select {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #323a46;
  border-radius: 10px;
  background: #0d1015;
}

.portal-logout {
  width: 100%;
}

.status-ok {
  color: #6dcaa8;
}

.hint {
  margin: 0.35rem 0 0.75rem;
  color: #ef9a9a;
  font-size: 0.86rem;
  font-weight: 650;
}

/* Legal pages */
.legal {
  padding: 2.5rem 0 3rem;
}

.legal h1 {
  margin: 0 0 0.75rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.legal h2 {
  margin: 1.6rem 0 0.55rem;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.legal p,
.legal li {
  margin: 0 0 0.75rem;
  color: var(--muted);
  max-width: 46rem;
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  max-width: 46rem;
  color: var(--muted);
}

.legal li {
  margin-bottom: 0.35rem;
}

.legal .note {
  padding: 0.9rem 1rem;
  border: 1px solid #3a3420;
  background: rgba(212, 163, 92, 0.08);
  border-radius: 10px;
  color: #d8c39a;
  max-width: 46rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.footer-nav {
  display: flex;
  gap: 1rem;
  font-weight: 650;
}

.footer-nav a:hover {
  color: var(--ink);
}
