/* Кабинет: светлая тема, те же токены что prive-theme.css — шапка не трогаем */

body.page-inner.cabinet-v2 {
  position: relative;
  padding-bottom: 32px;
  min-height: 100vh;
  /* Сплошная подложка — контент не зависит от слоёв градиента (избегаем багов Safari/WebView с fixed-bg на body) */
  background-color: var(--bg);
}

/* Градиент отдельным слоем: не трогает композицию и скролл основного потока */
body.page-inner.cabinet-v2::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 110% 65% at 92% -8%, rgba(196, 241, 53, 0.11) 0%, transparent 52%),
    radial-gradient(ellipse 75% 55% at -6% 92%, rgba(143, 184, 0, 0.055) 0%, transparent 48%),
    radial-gradient(ellipse 55% 45% at 48% 108%, rgba(15, 15, 14, 0.028) 0%, transparent 58%),
    linear-gradient(
      162deg,
      #fcfcf9 0%,
      #f8f6f1 32%,
      #f3f1ea 68%,
      var(--bg) 100%
    );
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Явный слой контента поверх ::before (z-index: -1), иначе в WebKit возможна «пустая» страница */
body.page-inner.cabinet-v2 > header,
body.page-inner.cabinet-v2 > main,
body.page-inner.cabinet-v2 > .cab-footer {
  position: relative;
  z-index: 0;
}

/* Шапка чуть ближе к верхнему «свету» градиента */
body.page-inner.cabinet-v2 header {
  background: linear-gradient(
    to bottom,
    rgba(252, 252, 249, 0.94) 0%,
    rgba(247, 246, 242, 0.9) 100%
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

@media (min-width: 768px) {
  body.page-inner.cabinet-v2 {
    padding-bottom: 0;
  }
}

.cabinet-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* Гость */
#cab-guest-view {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 0 32px;
}

#cab-guest-view.hidden {
  display: none !important;
}

.cab-login-stage {
  width: 100%;
  max-width: 420px;
  flex-shrink: 0;
}

.cab-mini-hint {
  width: 100%;
  max-width: 420px;
  margin-top: 20px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink3);
  text-align: center;
}
.cab-mini-hint a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cab-mini-hint a:hover {
  color: var(--lime-dark);
}
#cab-authed-view .cab-mini-hint--authed {
  max-width: none;
  margin-top: 18px;
  text-align: left;
  padding: 0;
}

.cab-login-glass {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 22px 30px;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 480px) {
  .cab-login-glass {
    padding: 32px 28px 34px;
  }
}

.cab-login-glass .cab-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 10px;
}

.cab-login-glass h1 {
  font-size: clamp(1.35rem, 4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}

.cab-login-glass .cab-lead {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink2);
  font-weight: 500;
}

.cab-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 20px 0 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.cab-trust span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
}

.cab-trust svg {
  flex-shrink: 0;
  color: var(--lime-dark);
}

.cab-email-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cab-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border2);
  background: var(--surface);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}

.cab-input::placeholder {
  color: var(--ink3);
  font-weight: 500;
}

.cab-input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--white);
}

.cab-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--r-sm);
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.cab-btn-primary:hover {
  background: #2a2a28;
}

.cab-btn-primary:active {
  transform: scale(0.99);
}

.cab-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.cab-btn-arrow {
  flex-shrink: 0;
  opacity: 0.9;
}

.cab-alert {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #9e2a1f;
}

.cab-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink2);
  margin-top: 18px;
  margin-bottom: 6px;
}

.cab-label:first-of-type {
  margin-top: 0;
}

/* Авторизован */
#cab-authed-view {
  padding-top: 8px;
}

#cab-authed-view.hidden {
  display: none !important;
}

.cab-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
}

.cab-session-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.cab-session-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cab-session-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cab-session-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
}

.cab-session-email {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
  line-height: 1.35;
}

.cab-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cab-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border2);
  background: var(--white);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink2);
  cursor: pointer;
  transition: background 0.15s;
}

.cab-pill-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.cab-pill-btn svg {
  opacity: 0.75;
}

.cab-pill-btn--ghost {
  border-color: transparent;
  background: transparent;
}

.cab-pill-btn--ghost:hover {
  background: var(--surface);
}

.cab-dashboard {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .cab-dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
}

.cab-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 20px 24px;
  box-shadow: var(--shadow);
}

@media (min-width: 480px) {
  .cab-panel {
    padding: 24px 22px 26px;
  }
}

.cab-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.cab-panel-head h3 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
}

.cab-stat {
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.cab-hint {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink2);
  font-weight: 500;
  margin-bottom: 10px;
}

.cab-url-box {
  padding: 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-all;
  min-height: 48px;
}

.cab-url-box a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cab-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border2);
  background: var(--white);
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font);
  color: var(--ink);
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.15s;
}

.cab-btn-secondary:hover {
  background: var(--surface);
}

a.cab-btn-secondary {
  text-decoration: none;
}

.cab-btn-secondary.cab-copied {
  border-color: rgba(31, 92, 58, 0.35);
  background: rgba(31, 92, 58, 0.08);
  color: #1f5c3a;
}

.cab-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cab-badge--ok {
  background: rgba(31, 92, 58, 0.1);
  color: #1f5c3a;
}

.cab-badge--off {
  background: var(--surface);
  color: var(--ink3);
}

.cab-badge--lime {
  background: var(--lime);
  color: var(--ink);
}

@media (min-width: 800px) {
  .cab-panel--ref {
    grid-column: 1 / -1;
  }
}

.cab-ref-perks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.cab-ref-perk {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink2);
  font-weight: 500;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(196, 241, 53, 0.1);
  border: 1px solid rgba(143, 184, 0, 0.22);
}

.cab-ref-perk strong {
  color: var(--ink);
  font-weight: 800;
}

.cab-ref-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.cab-ref-stat {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}

.cab-ref-stat-num {
  display: inline-block;
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--ink);
  margin-right: 6px;
  letter-spacing: -0.02em;
}

.cab-pm-line {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

.cab-callout {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--r-sm);
  background: rgba(196, 241, 53, 0.12);
  border: 1px solid rgba(143, 184, 0, 0.28);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink2);
  font-weight: 500;
}

.cab-footer {
  max-width: 920px;
  margin: 32px auto 0;
  padding: 20px 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cab-footer a {
  font-weight: 700;
  color: var(--ink2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.cab-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: center;
  flex: 1 1 200px;
}

.cab-footer-links a {
  font-size: 13px;
  font-weight: 700;
}

/* Модалка отвязки */
.unbind-modal.modal-root {
  z-index: 400;
  background: rgba(15, 15, 14, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.unbind-modal .modal-box {
  max-width: 420px;
  padding: 0;
  overflow: hidden;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-family: var(--font);
}

.unbind-modal-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.unbind-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.unbind-modal-head p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.5;
  font-weight: 500;
}

.unbind-modal-body {
  padding: 20px 22px 22px;
  background: var(--white);
}

.unbind-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.unbind-steps i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.25s;
}

.unbind-steps i.on {
  background: var(--ink);
}

.unbind-step {
  display: none;
}

.unbind-step.is-on {
  display: block;
}

.unbind-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.45;
  cursor: pointer;
  font-weight: 500;
}

.unbind-check input {
  margin-top: 3px;
  accent-color: var(--lime-dark);
}

.unbind-count-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}

.unbind-ring {
  --p: 0%;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: conic-gradient(var(--ink) var(--p), var(--border) 0);
  display: grid;
  place-items: center;
  position: relative;
}

.unbind-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.unbind-ring span {
  position: relative;
  font-size: 28px;
  font-weight: 800;
  z-index: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.unbind-count-hint {
  font-size: 13px;
  color: var(--ink2);
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
  font-weight: 500;
}

.unbind-captcha-box {
  margin-top: 8px;
  padding: 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.unbind-captcha-q {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
  color: var(--ink);
}

.unbind-captcha-box .cab-input {
  max-width: 180px;
  margin: 0 auto;
  display: block;
  text-align: center;
}

.unbind-phrase-sample {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px dashed var(--border2);
  margin: 10px 0 12px;
  word-break: break-all;
  color: var(--ink);
}

.unbind-err {
  color: #9e2a1f;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  min-height: 1.2em;
}

.unbind-modal-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.btn-unbind-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 0;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-unbind-primary:hover {
  background: #2a2a28;
}

.btn-unbind-primary:active {
  transform: scale(0.99);
}

.btn-unbind-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.unbind-modal .btn-ghost {
  font-family: var(--font);
  font-weight: 700;
  border-radius: 10px;
}
