/* ===================================================================
   ClonBot — app pages (pricing / auth / dashboard)
   Layered on styles.css tokens (--bg, --accent, --serif, --mono, .btn …)
   =================================================================== */

.appmain {
  min-height: calc(100vh - 64px);
  padding: clamp(40px, 7vw, 90px) var(--pad) 80px;
  position: relative;
  z-index: 3;
}
.appmain__head {
  max-width: var(--maxw);
  margin: 0 auto 44px;
  text-align: center;
}
.appmain__title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
}
.appmain__sub { color: var(--text-mid); margin-top: 12px; }

/* ---------- auth card ---------- */
.authwrap {
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 34px 30px 30px;
  position: relative;
}
.authwrap .bracket { width: 12px; height: 12px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 13px;
  transition: border-color 0.2s var(--ease);
}
.field input:focus { outline: none; border-color: var(--accent); }
.btn--block { width: 100%; justify-content: center; }
.oauth { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px; font-weight: 700;
  padding: 12px 16px; cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.oauth-btn:hover { border-color: var(--accent); box-shadow: 0 0 16px var(--accent-soft); }
.oauth-btn svg { width: 17px; height: 17px; flex: none; }
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-dim); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; margin: 4px 0 16px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.authmsg { min-height: 18px; font-size: 13px; margin-top: 10px; }
.authmsg--err { color: var(--accent); }
.authmsg--ok { color: var(--text-mid); }
.authfoot { text-align: center; color: var(--text-mid); font-size: 14px; margin-top: 18px; }
.authfoot a { color: var(--accent); }

/* ---------- pricing ---------- */
.toggle {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-mid);
  margin: 0 auto 8px; justify-content: center;
}
.switch { position: relative; width: 46px; height: 24px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--bg-raise);
  border: 1px solid var(--border); border-radius: 30px; transition: 0.2s;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: var(--text); border-radius: 50%; transition: 0.2s var(--ease);
}
.switch input:checked + .track { border-color: var(--accent); }
.switch input:checked + .track .knob { transform: translateX(22px); background: var(--accent); }
.save-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #050505; background: var(--accent);
  border-radius: 30px; padding: 3px 10px;
}
.pricing {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; max-width: var(--maxw); margin: 44px auto 0;
}
.plan {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; padding: 34px 28px; display: flex; flex-direction: column;
  position: relative;
}
.plan--featured { border-color: var(--accent-soft); box-shadow: 0 0 40px rgba(254,44,85,0.08); }
/* calm the page: let the eye land on Pro, the others quietly recede (desktop only) */
@media (min-width: 761px) {
  .plan:not(.plan--featured) {
    opacity: .72;
    transition: opacity .25s ease, border-color .25s ease;
  }
  .plan:not(.plan--featured):hover { opacity: 1; border-color: var(--border-strong); }
}
.plan__tag {
  position: absolute; top: -10px; left: 26px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #050505; background: var(--accent);
  padding: 3px 10px; border-radius: 30px;
}
.plan__name {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-mid);
}
.plan__price { font-family: var(--serif); font-size: 52px; line-height: 1; margin: 14px 0 2px; }
.plan__price span { font-family: var(--sans); font-size: 14px; color: var(--text-dim); }
.plan__credits { color: var(--text-mid); margin-bottom: 20px; font-size: 15px; }
.plan__credits b { color: var(--text); }
.plan .btn { margin-top: auto; }

/* ---------- dashboard ---------- */
.dash { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; }
.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; padding: 26px 26px;
}
.panel__label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px;
}
.creditrow { display: flex; align-items: baseline; justify-content: space-between; }
.creditbig { font-family: var(--serif); font-size: 46px; line-height: 1; }
.creditbig span { font-size: 22px; color: var(--text-dim); }
.bar { height: 7px; background: var(--bg-raise); border-radius: 30px; margin-top: 16px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--accent); border-radius: 30px; }
.muted { color: var(--text-dim); font-size: 13px; margin-top: 10px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.codebox {
  font-family: var(--mono); font-size: 14px; color: var(--accent);
  background: var(--bg-raise); border: 1px dashed var(--border-strong);
  border-radius: 2px; padding: 12px 14px; word-break: break-all; margin: 12px 0;
}
.pill {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 30px;
  border: 1px solid var(--border);
}
.pill--ok { color: #57d9a3; border-color: rgba(87,217,163,0.4); }
.pill--idle { color: var(--text-dim); }

/* ---------- telegram linking ---------- */
.dash--wide { max-width: 940px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tg-lead { color: var(--text-mid); font-size: 14.5px; line-height: 1.65; max-width: 56ch; margin: 0 0 20px; }

/* two paths, side by side on desktop: QR (primary) vs manual (fallback) */
.tg-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.tg-method { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 22px; background: var(--bg-raise); }
.tg-method--primary { border-color: var(--accent-soft);
  background: linear-gradient(180deg, rgba(254,44,85,0.06), transparent 55%), var(--bg-raise); }
.tg-method h3 { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.1; margin: 0 0 14px; }
.tg-method p { color: var(--text-mid); font-size: 13.5px; line-height: 1.6; margin: 0; }
.tg-badge { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; margin-bottom: 12px; color: var(--accent); }
.tg-method--muted .tg-badge { color: var(--text-dim); }

.tg-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 11px; }
.tg-steps li { display: flex; gap: 10px; align-items: center; color: var(--text-mid); font-size: 13.5px; line-height: 1.5; }
.tg-steps b { color: var(--text); }
.tg-num { flex: none; width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--accent-soft);
  color: var(--accent); font-family: var(--mono); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.tg-foot { color: var(--text-dim); font-size: 12.5px; margin: 18px 0 0; }

/* QR needs a light background to stay scannable on the dark dashboard. */
.tg-qr { background: #fff; padding: 12px; border-radius: 8px; width: 188px; margin: 4px 0 16px; }
.tg-qr svg { display: block; width: 100%; height: auto; }

/* how-it-works step cards */
.howsteps { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.howstep { border: 1px solid var(--border); border-radius: 8px; padding: 16px; background: var(--bg-raise); }
.howstep .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--accent); }
.howstep h4 { font-family: var(--serif); font-weight: 400; font-size: 18px; margin: 9px 0 6px; line-height: 1.1; }
.howstep p { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; margin: 0; }

/* ---------- pricing v2 ---------- */
.toggle-wrap { display: flex; justify-content: center; margin-bottom: 4px; }
.plan__desc { color: var(--text-dim); font-size: 13px; margin: 6px 0 0; min-height: 34px; line-height: 1.35; }
.plan__billed { display: block; font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 6px; letter-spacing: .03em; min-height: 14px; }
.plan__pervideo { font-family: var(--mono); font-size: 12px; color: var(--accent); margin: 12px 0 0; }
.plan__feats { list-style: none; margin: 16px 0 22px; display: grid; gap: 10px; }
.plan__feats li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-mid); font-size: 14px; line-height: 1.4; }
.plan__feats li svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--accent); }
.plan__feats li b { color: var(--text); font-weight: 600; }
.plan__feats li.feat-label { color: var(--text-dim); font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; }
.plan__feats li.feat-label::before { content: ""; }

/* every-plan strip */
.included { max-width: var(--maxw); margin: 64px auto 0; text-align: center; position: relative; z-index: 3; }
.included__title { font-family: var(--mono); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 24px; }
.included__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.included__item { border: 1px solid var(--border); border-radius: 3px; padding: 22px 14px; background: var(--bg-card); }
.included__item .k { font-family: var(--serif); font-size: 30px; line-height: 1; }
.included__item .k .accent { color: var(--accent); }
.included__item .v { color: var(--text-mid); font-size: 13px; margin-top: 8px; }

/* faq */
.faq { max-width: 760px; margin: 72px auto 0; position: relative; z-index: 3; }
.faq__h { font-family: var(--serif); font-size: clamp(26px, 4vw, 38px); text-align: center; margin-bottom: 10px; }
.faq__item { border-top: 1px solid var(--border); padding: 22px 0; }
.faq__item:last-child { border-bottom: 1px solid var(--border); }
.faq__item h4 { font-family: var(--sans); font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.faq__item p { color: var(--text-mid); font-size: 14px; line-height: 1.6; }

/* final cta */
.endcta { text-align: center; margin: 80px auto 0; max-width: 640px; position: relative; z-index: 3; }
.endcta h2 { font-family: var(--serif); font-size: clamp(32px, 5vw, 50px); line-height: 1.04; }
.endcta h2 em { font-style: italic; }
.endcta p { color: var(--text-mid); margin: 14px 0 26px; }

/* button loading spinner */
.btn.is-loading { opacity: 0.9; cursor: default; pointer-events: none; }
.spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: -2px;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .pricing { grid-template-columns: 1fr; }
  .included__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- dashboard shell (SPA) ---------- */
.app { display: flex; min-height: 100vh; position: relative; z-index: 3; }
.side {
  width: 232px; flex: none; background: var(--bg-card);
  border-right: 1px solid var(--border); padding: 20px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side__logo {
  display: flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-weight: 700; font-size: 15px; padding: 4px 8px 16px;
}
.side__nav { display: flex; flex-direction: column; }
.side__group {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-dim); margin: 16px 8px 8px;
}
.side__item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 6px; font-size: 14px; color: var(--text-mid);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.side__item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.side__item.is-on { background: var(--accent-soft); color: var(--text); }
.side__ic {
  width: 17px; height: 17px; flex: none; opacity: 0.7;
  transition: opacity 0.15s var(--ease);
}
.side__item:hover .side__ic, .side__item.is-on .side__ic { opacity: 1; }
.side__foot { margin-top: auto; }
.appcol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: none; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; background: rgba(5,5,5,.7);
  backdrop-filter: blur(8px); z-index: 5;
}
.topbar__credits {
  font-family: var(--mono); font-size: 12px; color: var(--text-mid);
  border: 1px solid var(--border); border-radius: 30px; padding: 5px 12px;
}
.topbar__user {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-raise); color: var(--text); font-family: var(--mono);
  font-size: 13px; cursor: pointer;
}
.viewport { padding: clamp(22px, 4vw, 40px); max-width: 1080px; width: 100%; }
.loading { color: var(--text-dim); font-family: var(--mono); font-size: 13px; padding: 40px 0; }

.v-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); }
.v-title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05; margin: 6px 0 24px; }
.v-section { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dim); margin: 30px 0 14px; }
.cardgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.statcard { border: 1px solid var(--border); background: var(--bg-card);
  border-radius: 6px; padding: 16px 18px; }
.statcard .l { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.statcard .k { font-family: var(--serif); font-size: 30px; line-height: 1; }

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row;
    flex-wrap: wrap; align-items: center; gap: 4px; }
  .side__nav { flex-direction: row; flex-wrap: wrap; }
  .side__group, .side__foot { display: none; }
  .cardgrid { grid-template-columns: repeat(2, 1fr); }
}

.howto { margin: 4px 0 14px 18px; color: var(--text-mid); font-size: 14px; line-height: 1.7; }
.howto li { margin-bottom: 6px; } .howto b { color: var(--text); }
.guide { display: grid; gap: 12px; }
.guide__item { display: flex; gap: 16px; border: 1px solid var(--border);
  background: var(--bg-card); border-radius: 8px; padding: 18px 20px; }
.guide__n { font-family: var(--serif); font-size: 26px; color: var(--accent); line-height: 1; flex: none; }
.guide__item h3 { font-family: var(--sans); font-size: 16px; font-weight: 600; margin-bottom: 5px; }
.guide__item p { color: var(--text-mid); font-size: 14px; line-height: 1.55; }

.hint { display: inline-block; font-family: var(--mono); font-size: 12px;
  color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 30px;
  padding: 7px 14px; margin-bottom: 20px; }
.usage { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.usage span { flex: 1; background: var(--accent-soft); border-radius: 2px 2px 0 0; min-height: 2px; }
.reclist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.reccard { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg-card); }
.recthumb { aspect-ratio: 9/16; background: #12101a center/cover no-repeat; }
.reccap { padding: 10px; font-size: 12px; color: var(--text-mid); line-height: 1.4;
  height: 50px; overflow: hidden; }

.avatargrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.avatar { text-align: left; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; padding: 0 0 12px; cursor: pointer; color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.avatar:hover:not(.is-soon) { border-color: var(--border-strong); }
.avatar.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 30px var(--accent-soft); }
.avatar.is-soon { opacity: 0.55; cursor: default; }
.avatar__img { aspect-ratio: 3/4; background: #16121d center/cover no-repeat; }
.avatar__img--lock { display: flex; align-items: center; justify-content: center; }
.avatar__name { font-size: 14px; padding: 10px 12px 0; }
.avatar__soon { display: inline-block; margin: 6px 12px 0; font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 30px; padding: 2px 8px; }
@media (max-width: 820px) { .avatargrid { grid-template-columns: repeat(2, 1fr); } }

.libgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.vid { border: 1px solid var(--border); background: var(--bg-card); border-radius: 8px; overflow: hidden; }
.vid__thumb { aspect-ratio: 9/16; background: #12101a center/cover no-repeat;
  position: relative; cursor: pointer; display: block; width: 100%; }
.vid__tag { position: absolute; top: 8px; left: 8px; font-family: var(--mono);
  font-size: 9px; background: rgba(0,0,0,.6); border: 1px solid var(--border-strong);
  border-radius: 30px; padding: 2px 8px; }
.vid__play { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: rgba(255,255,255,.6); font-size: 22px; }
.vid__meta { padding: 10px; }
.vid__cap { font-size: 12px; color: var(--text-mid); line-height: 1.4; height: 50px; overflow: hidden; }
.vid__acts { display: flex; gap: 5px; margin-top: 9px; }
.vid__b { flex: 1; font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em;
  text-transform: uppercase; border: 1px solid var(--border); border-radius: 5px;
  padding: 6px 0; color: var(--text-mid); background: transparent; cursor: pointer; }
.vid__b:hover { border-color: var(--border-strong); color: var(--text); }
.vid__b--pri { color: var(--text); border-color: var(--accent-soft); background: var(--accent-soft); }
.vid__b--x { flex: 0 0 30px; }
@media (max-width: 820px) { .libgrid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- legal pages (terms / privacy) ---------- */
.legal {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.7;
}
.legal p { margin: 0 0 16px; }
.legal h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 38px 0 12px;
}
.legal ul { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 9px; }
.legal a { color: var(--accent); }
.legal a:hover { text-decoration: underline; }
.legal strong { color: var(--text); font-weight: 600; }
.legal__imprint {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-mid);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  margin: 4px 0 28px;
}
.legal__imprint strong { color: var(--text); }
.legal__foot {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

/* ---------- signup terms acceptance ---------- */
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-mid);
  cursor: pointer;
}
.terms-check input { margin-top: 2px; accent-color: var(--accent); flex: none; }
.terms-check a { color: var(--accent); }
.terms-check a:hover { text-decoration: underline; }
