@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-variable-cyrillic-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF,
    U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-variable-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-variable-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #080a12;
  --panel: rgba(18, 21, 34, 0.82);
  --panel-strong: #121522;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f7ff;
  --muted: #9299ad;
  --purple: #a65cff;
  --purple-strong: #8d35ff;
  --cyan: #4de2e7;
  --pink: #ff5ca8;
  --green: #61e6a3;
  --red: #ff6f7e;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 5%, rgba(166, 92, 255, 0.16), transparent 30%),
    radial-gradient(circle at 8% 28%, rgba(77, 226, 231, 0.08), transparent 23%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  width: 36vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
}

.login-page::before {
  top: -14vw;
  right: -9vw;
  background: var(--purple);
}

.login-page::after {
  bottom: -18vw;
  left: -10vw;
  background: var(--cyan);
}

.login-shell {
  width: min(460px, calc(100% - 32px));
}

.login-card {
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(15, 18, 30, 0.88);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px);
}

.login-card h1 {
  margin: 6px 0 8px;
  font-family: Montserrat, sans-serif;
  font-size: clamp(38px, 10vw, 58px);
  letter-spacing: -0.055em;
}

.brand-mark {
  width: 46px;
  height: 38px;
  display: flex;
  align-items: end;
  gap: 5px;
  margin-bottom: 26px;
}

.brand-mark span {
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
}

.brand-mark span:nth-child(1) {
  height: 45%;
}

.brand-mark span:nth-child(2) {
  height: 100%;
}

.brand-mark span:nth-child(3) {
  height: 70%;
}

.brand-mark.small {
  width: 27px;
  height: 22px;
  gap: 3px;
  margin: 0;
}

.brand-mark.small span {
  width: 6px;
}

.eyebrow,
.step {
  margin: 0;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.muted,
.hero-copy,
.section-heading > p,
.hint {
  color: var(--muted);
  line-height: 1.65;
}

.stack {
  display: grid;
  gap: 16px;
}

.login-card .stack {
  margin-top: 30px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span,
.source-kind {
  color: #b6bdd0;
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  outline: none;
  background: rgba(5, 7, 13, 0.58);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: #62697c;
}

input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(166, 92, 255, 0.14);
}

.form-error,
.inline-message {
  min-height: 20px;
  margin: 0;
  color: #ff9ca7;
  font-size: 13px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple-strong), #c45dff);
  box-shadow: 0 10px 30px rgba(141, 53, 255, 0.2);
}

.button.secondary {
  border-color: rgba(166, 92, 255, 0.32);
  background: rgba(166, 92, 255, 0.1);
}

.button.danger {
  color: #ff9aa4;
  border-color: rgba(255, 111, 126, 0.24);
  background: rgba(255, 111, 126, 0.08);
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.wide {
  width: 100%;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
}

.topbar {
  height: 72px;
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.82);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: Montserrat, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-state {
  color: var(--muted);
  font-size: 12px;
}

.system-state i {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: #768097;
}

.system-state.healthy i {
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.system-state.warning i {
  background: #f6c85d;
}

.dashboard {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 100px;
}

.hero {
  min-height: 370px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 40px;
}

.hero h1 {
  max-width: 830px;
  margin: 15px 0 22px;
  font-family: Montserrat, sans-serif;
  font-size: clamp(45px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(90deg, #ffffff 10%, var(--purple) 55%, var(--cyan));
  background-clip: text;
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  font-size: 16px;
}

.hero-orbit {
  width: min(280px, 70vw);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  justify-self: end;
  border: 1px solid rgba(166, 92, 255, 0.26);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(166, 92, 255, 0.16), transparent 52%),
    rgba(255, 255, 255, 0.01);
}

.hero-orbit::before,
.hero-orbit::after {
  content: "";
  position: absolute;
  border: 1px dashed rgba(77, 226, 231, 0.2);
  border-radius: inherit;
}

.hero-orbit::before {
  inset: 16%;
}

.hero-orbit::after {
  inset: -7%;
}

.orbit-core {
  font-family: Montserrat, sans-serif;
  font-size: 92px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.orbit-label {
  position: absolute;
  bottom: 26%;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0 28px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.metric-card {
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 26px;
  border-radius: 18px;
}

.metric-card strong {
  font-family: Montserrat, sans-serif;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.metric-card small,
.metric-label {
  color: var(--muted);
}

.metric-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.section-nav {
  position: sticky;
  z-index: 10;
  top: 86px;
  display: flex;
  gap: 6px;
  margin: 28px 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 10, 18, 0.88);
  backdrop-filter: blur(18px);
}

.section-nav a {
  flex: 1;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  transition: color 150ms ease, background 150ms ease;
}

.section-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.section-panel {
  margin-top: 24px;
  padding: 34px;
  border-radius: var(--radius);
  scroll-margin-top: 156px;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.65fr);
  gap: 50px;
  align-items: end;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 8px 0 0;
  font-family: Montserrat, sans-serif;
  font-size: clamp(29px, 4vw, 43px);
  letter-spacing: -0.05em;
}

.section-heading > p {
  margin: 0;
  font-size: 13px;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.source-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(4, 6, 12, 0.38);
}

.source-card::before {
  content: "";
  width: 34px;
  height: 3px;
  margin-bottom: 3px;
  border-radius: 99px;
  background: var(--source-color, var(--purple));
}

.source-card.donation-alerts {
  --source-color: #f09a38;
}

.source-card.donatex {
  --source-color: #b268ff;
}

.source-card.donatepay {
  --source-color: #4edab5;
}

.source-name {
  font-weight: 800;
}

.source-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card small.connected {
  color: var(--green);
}

.span-all {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 6px;
}

.form-actions .inline-message {
  margin-right: auto;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
}

.control-card,
.preview-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(5, 7, 13, 0.38);
}

.divider {
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

.hint {
  margin: 0;
  font-size: 11px;
}

.preview-card {
  min-width: 0;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.status-pill {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
}

.status-pill.live {
  color: var(--green);
  border-color: rgba(97, 230, 163, 0.25);
  background: rgba(97, 230, 163, 0.07);
}

.obs-preview {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  background:
    linear-gradient(45deg, #121622 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(45deg, transparent 75%, #121622 75%) 0 0 / 20px 20px,
    linear-gradient(45deg, transparent 75%, #121622 75%) 10px -10px / 20px 20px,
    linear-gradient(45deg, #121622 25%, #0c0f18 25%) 10px -10px / 20px 20px;
}

.top-preview {
  font-family: Montserrat, sans-serif;
  font-weight: 900;
  text-align: center;
}

.top-preview h3 {
  margin: 0 0 14px;
  font-size: clamp(26px, 4vw, 44px);
}

.top-preview ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-preview li {
  font-size: clamp(18px, 2.4vw, 29px);
  line-height: 1.4;
}

.url-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.url-row input {
  min-width: 0;
  min-height: 42px;
  color: #aeb5c7;
  font-size: 12px;
}

.icon-button {
  min-height: 42px;
  color: var(--cyan);
  border-color: rgba(77, 226, 231, 0.2);
  background: rgba(77, 226, 231, 0.07);
  font-size: 12px;
}

.goal-preview {
  padding: 0;
}

.goal-preview-frame {
  width: 100%;
  height: 300px;
  border: 0;
  background: transparent;
}

.goal-preview-empty {
  width: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.goal-preview-empty strong {
  color: #e8ebf3;
  font-size: 15px;
}

.goal-preview-empty span {
  font-size: 12px;
}

.goal-preview-frame[hidden],
.goal-preview-empty[hidden] {
  display: none;
}

.import-result {
  display: grid;
  gap: 3px;
  padding: 13px;
  border: 1px solid rgba(97, 230, 163, 0.2);
  border-radius: 12px;
  background: rgba(97, 230, 163, 0.06);
}

.import-result span,
.import-result small {
  color: var(--muted);
  font-size: 11px;
}

.goal-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-top: 10px;
}

.goal-history {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.goal-history h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.history-row small {
  color: var(--muted);
}

.history-status {
  min-width: 78px;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.history-status.active {
  color: var(--green);
  background: rgba(97, 230, 163, 0.08);
}

.activity-list {
  display: grid;
}

.activity-row {
  display: grid;
  grid-template-columns: 90px 1fr auto 100px;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-row small {
  color: var(--muted);
  text-align: right;
}

.provider-tag {
  padding: 5px 8px;
  border-radius: 7px;
  color: #d8c3ff;
  background: rgba(166, 92, 255, 0.1);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.provider-tag.donatepay {
  color: #a4f3d7;
  background: rgba(78, 218, 181, 0.09);
}

.empty-state {
  margin: 0;
  padding: 28px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  border: 1px solid rgba(97, 230, 163, 0.22);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  background: #16251f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast[data-tone="error"] {
  border-color: rgba(255, 111, 126, 0.25);
  background: #28171c;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .dashboard {
    width: min(100% - 24px, 680px);
    padding-top: 42px;
  }

  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 42px 0;
  }

  .hero-orbit {
    display: none;
  }

  .summary-grid,
  .sources-grid,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-nav {
    overflow-x: auto;
  }

  .section-nav a {
    min-width: 120px;
  }

  .section-panel {
    padding: 22px;
  }

  .goal-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 0 14px;
  }

  .system-state {
    display: none;
  }

  .hero h1 {
    font-size: 45px;
  }

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

  .metric-card {
    min-height: 112px;
  }

  .form-actions,
  .history-row {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions {
    display: grid;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .activity-row {
    grid-template-columns: 80px 1fr;
  }

  .activity-row small {
    text-align: left;
  }

  .url-row {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 30px 24px;
  }
}
