﻿:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #d7e1ec;
  --line-strong: #c4d2e0;
  --text: #13253b;
  --muted: #5f738d;
  --accent: #123f70;
  --accent-soft: #e9f1f9;
  --danger: #c43d3d;
  --ok: #1f9d70;
}

:root[data-theme="dark"] {
  --bg: #0f1722;
  --surface: #141f2d;
  --surface-soft: #182638;
  --line: #26384d;
  --line-strong: #34506c;
  --text: #e5edf7;
  --muted: #9db0c7;
  --accent: #6fa6e6;
  --accent-soft: #1d3147;
  --danger: #ff8d8d;
  --ok: #72d5ae;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Chivo", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  padding: 1rem;
}

.topbar {
  max-width: 1100px;
  margin: 0 auto 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
}

.brand__dot {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50%;
  background: var(--accent);
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  font-size: 0.85rem;
  font-family: "Chivo", sans-serif;
}

button.pill {
  cursor: pointer;
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 0.95rem;
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  padding: 1rem;
}

.side-card h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.subtle {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.feature-list {
  margin: 0.95rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.feature-list li {
  margin-bottom: 0.45rem;
}

.session-box {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-soft);
  padding: 0.8rem;
}

.session-box__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.session-box__value {
  margin: 0.35rem 0 0.7rem;
  font-weight: 700;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  border-radius: 0.62rem;
  padding: 0.56rem 0.5rem;
  font-family: "Chivo", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.auth-form {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.auth-form[hidden] {
  display: none !important;
}

.auth-form h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
}

.mode-hint {
  margin: 0.7rem 0 0;
  color: var(--accent);
  font-size: 0.84rem;
}

.field {
  display: grid;
  gap: 0.36rem;
}

.field span {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 0.62rem;
  padding: 0.66rem 0.74rem;
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
  font-family: "Chivo", sans-serif;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.switch-inline {
  margin: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-primary,
.btn-ghost {
  appearance: none;
  border-radius: 0.62rem;
  border: 1px solid var(--line);
  padding: 0.62rem 0.82rem;
  font-weight: 700;
  font-family: "Chivo", sans-serif;
  cursor: pointer;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #f5f8ff;
}

:root[data-theme="dark"] .btn-primary {
  color: #0f2235;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
}

.profile-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.72rem;
}

.profile-image,
.profile-fallback {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.profile-image {
  object-fit: cover;
  background: var(--surface);
}

.profile-fallback {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "Syne", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.stats-grid {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid article {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-soft);
  padding: 0.8rem;
}

.stats-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.stats-grid strong {
  display: block;
  margin-top: 0.28rem;
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  line-height: 1.3;
}

.settings-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.settings-section h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
}

.inline-form {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.premium-cta {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.pricing-grid {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pricing-card {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface-soft);
  padding: 0.85rem;
}

.pricing-card h4 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 0.98rem;
}

.pricing-list {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.pricing-list li {
  margin: 0;
}

.pricing-choice {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font: inherit;
  padding: 0.62rem 0.72rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.pricing-choice:hover {
  border-color: var(--accent);
}

.pricing-choice.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.pricing-list strong {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
}

.pricing-choice__action {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.premium-text {
  margin: 0;
  color: var(--accent);
  font-family: "Syne", sans-serif;
  font-size: 1rem;
}

.tool-list {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.tool-list li {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-soft);
  padding: 0.75rem;
}

.tool-list strong,
.tool-list span {
  display: block;
}

.tool-list strong {
  font-family: "Syne", sans-serif;
}

.tool-list span {
  margin-top: 0.24rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-message {
  margin: 0.85rem 0 0;
  min-height: 1.3rem;
  font-size: 0.88rem;
}

.auth-message--error {
  color: var(--danger);
}

.auth-message--ok {
  color: var(--ok);
}

.reveal {
  animation: revealUp 380ms ease-out both;
}

.delay-1 {
  animation-delay: 70ms;
}

@media (max-width: 900px) {
  body {
    padding: 0.85rem;
  }

  .topbar {
    align-items: stretch;
    margin-bottom: 0.85rem;
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .card {
    padding: 0.9rem;
    border-radius: 0.86rem;
  }

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

@media (min-width: 980px) {
  body {
    padding: 1.5rem;
  }

  .layout {
    grid-template-columns: minmax(320px, 420px) 1fr;
    align-items: start;
  }
}

@media (max-width: 700px) {
  body {
    padding: 0.65rem;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    gap: 0.34rem;
    padding-bottom: 0.12rem;
    scroll-snap-type: x proximity;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab {
    flex: 1 0 6.6rem;
    font-size: 0.82rem;
    padding: 0.52rem 0.42rem;
    scroll-snap-align: start;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }

  .profile-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

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

  .inline-form {
    grid-template-columns: 1fr;
  }

  .premium-cta {
    align-items: stretch;
  }

  .premium-cta .btn-primary {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .side-card h1 {
    font-size: 1.2rem;
  }

  .subtle {
    font-size: 0.87rem;
  }

  .check-row {
    align-items: flex-start;
  }

  .profile-actions {
    width: 100%;
  }

  .profile-actions .btn-ghost {
    flex: 1 1 100%;
  }

  .stats-grid article,
  .tool-list li {
    padding: 0.72rem;
  }
}

@media (max-width: 420px) {
  body {
    padding: 0.5rem;
  }

  .card {
    padding: 0.78rem;
  }

  .tabs {
    gap: 0.28rem;
  }

  .tab {
    flex-basis: 6rem;
    font-size: 0.78rem;
    padding: 0.48rem 0.38rem;
  }

  .auth-form h2 {
    font-size: 1.05rem;
  }

  .field input {
    padding: 0.6rem 0.66rem;
    font-size: 0.88rem;
  }

  .mode-hint,
  .auth-message {
    font-size: 0.82rem;
  }
}

@media (min-width: 740px) {
  .inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
