/* =========================================================
   Daryger Admin — вход и консоль
   Палитра общая с остальными панелями экосистемы, вёрстка своя:
   служебная система, тёмная по умолчанию.

   Строгий CSP (style-src 'self'): никаких inline-стилей, всё здесь.
   ========================================================= */

/* ---------- 1. Токены ---------- */
:root {
  --bg:        #EDF1F6;
  --bg-2:      #E2E8EF;
  --surface:   rgba(255, 255, 255, .78);
  --surface-2: rgba(255, 255, 255, .55);
  --solid:     #FFFFFF;
  --border:    rgba(174, 189, 204, .70);
  --border-2:  #AEBDCC;
  --text:      #0A121B;
  --text-2:    #44566C;
  --text-3:    #66788C;

  --brand:     #0A6A63;
  --brand-2:   #14A79C;
  --brand-3:   #38CFC0;
  --brand-soft: rgba(14, 124, 116, .10);
  --brand-ink: #FFFFFF;
  --ring:      rgba(20, 167, 156, .30);

  --danger:    #C93A3A;
  --danger-soft: rgba(209, 67, 67, .10);
  --warn:      #A8700A;
  --warn-soft: rgba(201, 138, 18, .12);
  --ok:        #12805E;
  --ok-soft:   rgba(23, 145, 107, .12);

  --aurora-1:  rgba(20, 167, 156, .30);
  --aurora-2:  rgba(86, 138, 214, .22);
  --grid-line: rgba(10, 18, 27, .05);

  --shadow:    0 24px 60px -24px rgba(13, 22, 32, .28), 0 2px 8px rgba(13, 22, 32, .06);
  --shine:     inset 0 1px 0 rgba(255, 255, 255, .75);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.22, .68, .32, 1);
}

html[data-theme="dark"] {
  --bg:        #050A11;
  --bg-2:      #0A111B;
  --surface:   rgba(14, 24, 37, .78);
  --surface-2: rgba(16, 27, 42, .52);
  --solid:     #0F1927;
  --border:    rgba(255, 255, 255, .09);
  --border-2:  #3B5170;
  --text:      #EDF3FA;
  --text-2:    #A9BACE;
  --text-3:    #7F92A9;

  --brand:     #21B5A6;
  --brand-2:   #2FC7B9;
  --brand-3:   #5CE3D4;
  --brand-soft: rgba(47, 199, 185, .12);
  --brand-ink: #04211F;
  --ring:      rgba(47, 199, 185, .30);

  --danger:    #EF7B7B;
  --danger-soft: rgba(239, 123, 123, .12);
  --warn:      #E3B155;
  --warn-soft: rgba(227, 177, 85, .12);
  --ok:        #3ECFA0;
  --ok-soft:   rgba(62, 207, 160, .12);

  --aurora-1:  rgba(47, 199, 185, .20);
  --aurora-2:  rgba(58, 108, 205, .20);
  --grid-line: rgba(255, 255, 255, .045);

  --shadow:    0 28px 70px -24px rgba(0, 0, 0, .85), 0 2px 10px rgba(0, 0, 0, .40);
  --shine:     inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* ---------- 2. Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Фон: сетка и два пятна света. Неподвижный — служебной системе
   движение на фоне ни к чему */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(60vmax 60vmax at 12% -10%, var(--aurora-1), transparent 62%),
    radial-gradient(55vmax 55vmax at 100% 105%, var(--aurora-2), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

body::after {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 78%);
}

h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- 3. Шапка ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
}

.top--bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-block: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo__img { border-radius: 10px; }

.logo__text { display: flex; flex-direction: column; line-height: 1.1; }

.logo__name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }

.logo__sub {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.top__side { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn svg { width: 18px; height: 18px; }

html[data-theme="dark"] .icon-btn .i-moon,
html[data-theme="light"] .icon-btn .i-sun { display: none; }

/* ---------- 4. Вход ---------- */
.gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 12px 16px 40px;
}

.gate__col { width: 100%; max-width: 432px; }

.card {
  position: relative;
  padding: 32px clamp(20px, 5vw, 34px) 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow), var(--shine);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  backdrop-filter: saturate(170%) blur(20px);
}

/* Тонкая светящаяся кромка сверху — единственное украшение карточки */
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  right: 28px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-2), var(--brand-3), transparent);
  opacity: .85;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge svg { width: 14px; height: 14px; }

.card__title {
  margin-top: 16px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
}

.card__lead { margin-top: 8px; color: var(--text-2); font-size: 14.5px; }

/* Шаги: пароль → Telegram */
.steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
}

.step { display: inline-flex; align-items: center; gap: 8px; }

.step__n {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.step.is-on { color: var(--text); }
.step.is-on .step__n { border-color: var(--brand-2); background: var(--brand-2); color: var(--brand-ink); }
.step.is-done { color: var(--ok); }
.step.is-done .step__n { border-color: var(--ok); color: var(--ok); }

.steps__line { flex: 1; height: 1px; background: var(--border-2); opacity: .6; }

/* Поля */
.field { margin-bottom: 14px; }

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.field__box { position: relative; }

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: var(--solid);
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.input::placeholder { color: var(--text-3); opacity: .8; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--ring); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.input--pad { padding-right: 46px; }

.input--code {
  height: 60px;
  padding: 0 0 0 .5em;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.peek {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.peek:hover { color: var(--text); }
.peek svg { width: 18px; height: 18px; }
.peek[aria-pressed="true"] .i-eye,
.peek[aria-pressed="false"] .i-eye-off { display: none; }

.hint { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn--block { width: 100%; }

.btn--primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: var(--brand-ink);
  box-shadow: 0 10px 26px -12px var(--brand-2);
}

.btn--primary:hover:not(:disabled) { box-shadow: 0 14px 30px -12px var(--brand-2); }

.btn--ghost {
  border-color: var(--border-2);
  background: transparent;
  color: var(--text-2);
}

.btn--ghost:hover:not(:disabled) { color: var(--text); border-color: var(--text-3); }

.btn--sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }

.btn--danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn--danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn.is-busy { color: transparent; position: relative; }

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn--ghost.is-busy::after { border-color: var(--text-2); border-right-color: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.linkish:hover:not(:disabled) { text-decoration: underline; }
.linkish:disabled { color: var(--text-3); cursor: default; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 13.5px; }

/* Сообщения */
.alert {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid var(--danger);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
}

.alert--warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.alert--ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* Экран привязки Telegram */
.wait {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--text-2);
  font-size: 13.5px;
}

.wait__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-2);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}

.target { font-family: var(--mono); font-weight: 600; color: var(--text); }

/* Три факта под карточкой */
.facts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.fact {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
}

.fact svg { flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--brand-2); }
.fact b { color: var(--text); font-weight: 600; }

.foot {
  padding: 18px 16px 26px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ---------- 5. Консоль ---------- */
.who {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}

.who__mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 48px;
}

.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.hero__title { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.hero__lead { margin-top: 6px; color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.chip svg { width: 14px; height: 14px; }
.chip--ok { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.chip--warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.chip b { color: var(--text); font-variant-numeric: tabular-nums; }

.section { margin-top: 34px; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.section__title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.section__note { font-size: 13px; color: var(--text-3); }

.grid { display: grid; gap: 14px; }
.grid--plans { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid--two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.tile {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shine);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
}

.tile__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile__name { font-weight: 700; }
.tile__sub { font-size: 12px; color: var(--text-3); }

.tile__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
}

.tile__icon svg { width: 19px; height: 19px; }

.empty {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

.plans { margin-top: 14px; display: grid; gap: 10px; }

.plan { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.plan__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan__name { font-weight: 600; }
.plan__price { margin-top: 4px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.plan__price span { color: var(--text-3); }
.plan__meta { margin-top: 4px; font-size: 12px; color: var(--text-3); }

.tag {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--muted { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }

.stat__n { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__l { margin-top: 4px; font-size: 13px; color: var(--text-2); }

.list { margin-top: 12px; }

.list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  font-size: 13.5px;
}

.list__row + .list__row { border-top: 1px solid var(--border); }
.list__main { min-width: 0; overflow-wrap: anywhere; }
.list__main small { display: block; font-size: 12px; color: var(--text-3); }
.list__side { flex: none; font-size: 12.5px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }

.dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--text-3); vertical-align: 1px; }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }
.dot--bad { background: var(--danger); }

.tile__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tile__msg { font-size: 13px; color: var(--text-2); }

.note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 13.5px;
  color: var(--text-2);
}

/* ---------- 6. Мелкие экраны и движение ---------- */
@media (max-width: 560px) {
  .who__name { display: none; }
  .who { padding: 4px; }
  .input--code { font-size: 24px; letter-spacing: .38em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 7. Мелочи консоли ---------- */
.list--flush { margin-top: 0; }
.list--flush .list__row:first-child { padding-top: 2px; }
.list--flush .list__row:last-child { padding-bottom: 2px; }

code {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: .92em;
  overflow-wrap: anywhere;
}
