:root {
  --bg: #f6fff6;
  --card: rgba(255,255,255,0.92);
  --card2: rgba(255,255,255,0.98);
  --text: #111111;
  --muted: rgba(17,17,17,0.68);
  --muted2: rgba(17,17,17,0.50);
  --border: rgba(0,0,0,0.14);
  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;
  --btn: #ffffff;
  --btn2: rgba(22,163,74,0.10);

  --green: #16a34a;
  --green2: #22c55e;

  --container: 900px;
  --content: 720px;
}


* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(34,197,94,0.20), transparent 55%),
    radial-gradient(900px 500px at 80% 10%, rgba(22,163,74,0.14), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a { color: var(--green); }
.hidden { display: none !important; }
.page { display: block; }

.card {
  width: min(520px, calc(100% - 32px));
  margin: 40px auto;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}


/* ===== Logo ===== */
.logo-block {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  margin-top: 2px;
}
.logo-img {
  width: min(260px, 70%);
  height: auto;
  display: block;
}
.topbar-logo {
  width: 64px;
  height: auto;
  object-fit: contain;
  display: block;
}
@media (max-width: 600px) {
  .logo-img { width: min(220px, 78%); }
  .topbar-logo { width: 48px; height: auto; }
}


/* ===== common form ===== */
.form { display: grid; gap: 10px; margin-top: 12px; }
.label { color: var(--muted); font-size: 13px; }
.hint { margin-top: 10px; opacity: .75; font-size: 13px; }
.msg { margin-top: 10px; color: var(--muted); }
.msg.ok { color: rgba(45,212,191,0.95); }
.msg.err { color: rgba(251,113,133,0.95); }
.msg.warn { color: rgba(251,191,36,0.95); }

.input, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
.input:focus, .textarea:focus { border-color: rgba(22,163,74,0.65); box-shadow: 0 0 0 4px rgba(34,197,94,0.12); }
.textarea { min-height: 56px; resize: vertical; }

/* ===== buttons ===== */
.btn, a.btn {
  cursor: pointer;
  border: 1px solid rgba(22,163,74,0.30);
  background: var(--btn);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover, a.btn:hover { background: var(--btn2); border-color: rgba(22,163,74,0.55); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.primary { background: var(--green); border-color: rgba(22,163,74,0.70); color: #ffffff; }
.btn.danger { border-color: rgba(239,68,68,0.55); color: #b91c1c; background: rgba(239,68,68,0.08); }
.btn.danger:hover { border-color: rgba(239,68,68,0.80); background: rgba(239,68,68,0.12); }

.btn--ghost { background: transparent; }
.btn--mini { height: 38px; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn--xs { height: 32px; padding: 6px 10px; font-size: 12px; border-radius: 10px; }

.row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 240px; }

.pre {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  min-height: 44px;
  overflow: auto;
}

/* ===== APP layout ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(var(--container), calc(100% - 32px));
  margin: 24px auto 0;
}
.brand { font-weight: 800; color: var(--text); display:flex; align-items:center; gap:10px; }
.brand--with-logo span{ line-height:1; }

#view-app {
  display: block;
}
#view-app .grid {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.block {
  margin: 18px 0;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.block h2 { margin: 0 auto 14px; width: min(100%, var(--content)); font-size: 21px; font-weight: 600; letter-spacing: .1px; position: relative; padding-bottom: 10px; text-align: left; }

.list { display: grid; gap: 10px; margin-top: 12px; }

/* ===== LK bind ===== */
.lk-bind { display: block; max-width: var(--content); margin-left: auto; margin-right: auto; }
.lk-bind__left { width: 100%; }

#accountsList { width: 100%; max-width: var(--content); margin-left: auto; margin-right: auto; }

.acc {
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(22,163,74,0.05);
  border: 1px solid rgba(0,0,0,0.10);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.acc:hover { background: rgba(22,163,74,0.08); }
.acc--active { outline: 2px solid rgba(120,180,255,.55); background: rgba(77,163,255,0.12); }

.acc__left { display:flex; flex-direction:column; gap:6px; }
.acc__id { font-weight: 700; letter-spacing: .4px; }
.acc__label { opacity: .85; font-size: 13px; }

.acc__right {
  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap: wrap;
  max-width: 100%;
}

.badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.10);
  color: var(--muted);
}
.badge--default { color: rgba(22,163,74,0.95); border-color: rgba(22,163,74,0.45); background: rgba(22,163,74,0.06); }

/* ===== Debt row alignment ===== */
.debt-row { align-items: flex-end; }
.debt-row .input { width: 220px; min-width: 220px; height: 44px; flex: none; }
.debt-row #btnLoadDebt { min-width: 160px; }

/* ===== Pay actions ===== */
.pay-actions { justify-content: center; }
.pay-actions .btn { min-width: 220px; }

/* ===== captcha & checkbox (registration/reset) ===== */
.captcha-box { display:flex; align-items:center; gap:12px; margin:10px 0 14px; }
.captcha-img { height:52px; border-radius:10px; border:1px solid rgba(0,0,0,.12); background:#fff; }
.checkbox { display:flex; gap:10px; align-items:flex-start; margin-top:10px; }
.checkbox input{ margin-top:3px; }

/* ===== modal ===== */
.modal { position: fixed; inset: 0; z-index: 1000; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }

.modal__content {
  position: relative;
  width: 80vw;
  height: 80vh;
  max-width: 1100px;
  margin: 10vh auto;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}
.modal__title { font-weight: 600; color: #111; }
.modal__close { background: none; border: none; font-size: 22px; cursor: pointer; color:#111; }
.modal__body { flex: 1; }
.modal__iframe { width: 100%; height: 100%; border: 0; }
.modal__footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* QR modal */
.modal__content--qr {
  width: 320px;
  max-width: 90vw;
  height: auto;
  margin: 20vh auto;
}
.modal__body--center { display:flex; justify-content:center; align-items:center; }
#qrModalImg { max-width: 100%; height: auto; border-radius: 8px; }

/* Buttons inside modal must be readable on white */
.modal .btn, .modal a.btn {
  color: #111 !important;
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
}
.modal .btn:hover, .modal a.btn:hover { background: #e5e7eb !important; }
.modal .btn.primary { background: var(--green); border-color: rgba(22,163,74,0.70); color: #ffffff; }

@media (max-width: 768px) {
  .pay-actions { justify-content: center; }
  .pay-actions .btn { min-width: 0; width: 100%; }
  .debt-row .input { width: 100%; min-width: 0; }
  .debt-row #btnLoadDebt { width: 100%; }
}
/* ===== FINAL UI POLISH ===== */

/* 1. Единая высота и радиус для всех кнопок */
.btn {
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
}

/* 2. ОДИНАКОВАЯ ШИРИНА КНОПОК (где это UX-логично) */
#btnBindAccount,
#btnLoadDebt,
.pay-actions .btn {
  min-width: 220px;
}

/* кнопки в списке ЛС — компактнее */
#accountsList .btn {
  min-width: 140px;
  height: 36px;
  font-size: 13px;
}

/* 3. Компактнее отступы между секциями */
.block {
  padding: 16px;
  margin-bottom: 16px;
}

/* заголовки секций — ближе к контенту */
.block h2 {
  margin-bottom: 12px;
}

/* 4. Компактнее поля */
.field {
  margin-bottom: 8px;
}

.label {
  margin-bottom: 6px;
  font-size: 13px;
}

/* 5. Строки форм — меньше вертикального воздуха */
.row {
  gap: 12px;
  margin-bottom: 8px;
}

/* 6. Список ЛС — плотнее карточки */
#accountsList .acc {
  padding: 10px 12px;
  border-radius: 14px;
}

/* бейджи компактнее */
.badge {
  height: 22px;
  font-size: 12px;
  padding: 0 8px;
}

/* 7. Оплата — аккуратный центр */
.pay-actions {
  margin-top: 8px;
}

/* 8. Мобилка: кнопки во всю ширину */
@media (max-width: 600px) {
  #btnBindAccount,
  #btnLoadDebt,
  .pay-actions .btn {
    width: 100%;
    min-width: 100%;
  }
}
/* ===== Button loading state ===== */
.btn[disabled],
.btn.is-loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* маленький спиннер внутри кнопки */
.btn .spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(17,17,17,0.20);
  border-top-color: rgba(17,17,17,0.65);
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

/* если кнопка НЕ primary — спиннер чуть темнее */
.btn:not(.primary) .spinner {
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: rgba(255,255,255,0.75);
}

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

.btn.primary .spinner { border: 2px solid rgba(255,255,255,0.35); border-top-color: rgba(255,255,255,0.95); }
/* ===== Topbar (Личный кабинет) ===== */

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 16px 24px;
}

.topbar-left {
  justify-self: start;
}

.topbar-center {
  justify-self: center;
}

.topbar-right {
  justify-self: end;
}

/* Логотип в ЛК */
.topbar-logo {
  height: 65px;           /* <<< РАЗМЕР ЛОГО */
  width: auto;
  display: block;
}
/* ===== Mobile header fix (<= 640px) ===== */
@media (max-width: 640px) {

  /* Шапка: 3 колонки (лево / центр / право) */
  .topbar{
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    gap: 10px !important;

    padding: 10px 12px !important;
    min-height: 56px;
  }

  /* Заголовок слева */
  .topbar .title{
    justify-self: start !important;
    margin: 0 !important;

    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Лого строго по центру */
  .topbar-center{
    justify-self: center !important;
    align-self: center !important;
    margin: 0 !important;
  }

  .topbar-logo{
    height: 34px !important;   /* нормальный размер на мобилке */
    width: auto !important;
    max-width: 160px !important;
    display: block;
  }

  /* Кнопка "Выйти" строго справа и без переноса вниз */
  #btnLogout{
    justify-self: end !important;
    align-self: center !important;

    margin: 0 !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
  }
}

.acc__fio{
  margin-top: 4px;
  font-size: 12px;
  opacity: .75;
  line-height: 1.2;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ===== Mode buttons (bind panels) ===== */
.lk-mode-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.lk-mode-buttons .btn.is-active {
  outline: 2px solid rgba(0,0,0,0.25);
}
/* Panels animation */
.lk-panel {
  /* overflow must be visible so absolute suggestion dropdowns are not clipped */
  overflow: visible;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  opacity: 1;
}
.lk-panel.is-collapsed {
  /* collapsed panels should clip their own content */
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ===== Suggest dropdown (custom) ===== */
.suggest-wrap{
  position: relative;
}

.suggest-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  /* keep above other inputs/cards */
  z-index: 2000;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
  max-height: 360px; /* ~10 items */
  overflow-y: auto;
}

.suggest-box[hidden]{
  display: none;
}
.suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.suggest-item + .suggest-item {
  border-top: 1px solid rgba(0,0,0,0.08);
}
.suggest-item.is-active,
.suggest-item:hover {
  background: rgba(0,0,0,0.05);
}
.suggest-loading {
  padding: 10px 12px;
  opacity: 0.8;
}
/* ===================================== */

/* ===== Debt inline (always visible) ===== */
.debt-inline {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(26, 176, 90, 0.25);
  border-radius: 12px;
  background: rgba(26, 176, 90, 0.06);
}

.debt-box {
  margin: 6px 0 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.06);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  min-height: 44px;
}
/* ======================================= */


/* ===== Mobile fixes (accounts list & buttons) ===== */
@media (max-width: 560px) {
  html, body { overflow-x: hidden; }

  /* main container */
  .grid { padding-left: 8px; padding-right: 8px; }

  /* make cards fit viewport */
  #accountsList { max-width: 100%; }

  .acc {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .acc__left, .acc__fio { min-width: 0; max-width: 100%; }

  .acc__right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  /* allow buttons to shrink; stack them */
  #accountsList .btn,
  #btnBindAccount,
  #btnLoadDebt,
  .pay-actions .btn {
    min-width: 0 !important;
    width: 100%;
  }

  /* make small badges not break layout */
  .badge { align-self: flex-start; }
}


/* ===== LK layout refinements (restore material-like grid) ===== */

.block .content{
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
}

.block h2::after{
  content:"";
  position:absolute;
  left:0;
  bottom:0;
  height:3px;
  width:min(360px, 70%);
  background: rgba(22,163,74,0.35);
  border-radius: 999px;
}

.pay-actions{
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

#payMsg{
  margin-top: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* "chip" status style for payMsg */
#payMsg:not(:empty){
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(22,163,74,0.22);
  background: rgba(22,163,74,0.06);
  color: rgba(17,17,17,0.78);
  font-size: 13px;
}
#payMsg:not(:empty)::before{
  content:"";
  width:8px;height:8px;border-radius:999px;
  background: rgba(22,163,74,0.85);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}
#payMsg.ok:not(:empty){ border-color: rgba(22,163,74,0.28); background: rgba(22,163,74,0.08); }
#payMsg.ok:not(:empty)::before{ background: rgba(22,163,74,0.90); }
#payMsg.warn:not(:empty){ border-color: rgba(245,158,11,0.28); background: rgba(245,158,11,0.08); }
#payMsg.warn:not(:empty)::before{ background: rgba(245,158,11,0.90); box-shadow: 0 0 0 3px rgba(245,158,11,0.12); }
#payMsg.err:not(:empty){ border-color: rgba(239,68,68,0.28); background: rgba(239,68,68,0.08); }
#payMsg.err:not(:empty)::before{ background: rgba(239,68,68,0.90); box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

/* Payments history */
.payments-toolbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.segmented{
  display:inline-flex;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.70);
}

.segmented__btn{
  appearance:none;
  border:0;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  cursor:pointer;
  color: rgba(17,17,17,0.75);
}
.segmented__btn.is-active{
  background: rgba(22,163,74,0.12);
  color: rgba(17,17,17,0.90);
  font-weight: 650;
}

.payments-list{
  display:grid;
  gap: 10px;
  margin-top: 12px;
}

.pay-item{
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 12px 14px;
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pay-item__left{
  min-width: 0;
}
.pay-item__title{
  font-weight: 700;
  font-size: 14px;
}
.pay-item__meta{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(17,17,17,0.65);
}
.pay-item__right{
  text-align: right;
  white-space: nowrap;
  font-weight: 750;
}

@media (max-width: 560px){
  .block{ padding: 14px; }
  .block h2{ font-size: 20px; }
  .block h2::after{ width: min(260px, 75%); }

  .pay-item{ flex-direction: column; align-items: stretch; }
  .pay-item__right{ text-align:left; }
  #payMsg{ width: 100%; justify-content: center; }
  #payMsg:not(:empty){ width: 100%; justify-content:center; text-align:center; }
}




/* ===== Auth UI fixes (merged) ===== */
html, body{
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100vh;

  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(34,197,94,0.20), transparent 55%),
    radial-gradient(900px 500px at 80% 10%, rgba(22,163,74,0.14), transparent 55%),
    var(--bg);

  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.title{
  margin: 10px 0 14px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.01em;
}
@media (max-width: 560px){
  .title{ font-size: 24px; }
}


.page { display: block; }

.card {
  width: min(520px, calc(100% - 32px));
  margin: 40px auto;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.stepbar{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 12px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(22,163,74,0.22);
  background: rgba(22,163,74,0.06);
}

.stepbar{ flex-direction: column; align-items: flex-start; gap: 8px; }

.stepbar .step-pill{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(22,163,74,0.20);
  font-size: 12px;
  font-weight: 700;
  color: rgba(17,17,17,0.82);
  white-space: nowrap;
}

.step-pill{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(22,163,74,0.20);
  font-size: 12px;
  font-weight: 700;
  color: rgba(17,17,17,0.82);
  white-space: nowrap;
}

.step-text{
  font-size: 13px;
  color: rgba(17,17,17,0.70);
}
/* ===== Header fix ===== */

.header-title,
.lk-header-title,
.header h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.header,
.lk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header .logo,
.lk-header .logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
/* ===== Center bind buttons ===== */

#blockBind .bind-actions,
#blockBind .bind-buttons,
.bind-actions,
.bind-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

#blockBind > button {
  margin: 0 8px;
}

/* ===== Center payment buttons ===== */

#blockPay .actions,
#blockPay .pay-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}
/* ===== Auth spacing fix ===== */

.auth-form button,
.auth-card button {
  margin-top: 16px;
}

.auth-form .captcha + button,
.auth-card .captcha + button {
  margin-top: 20px;
}
form button {
  margin-top: 16px;
}


/* ===== HOTFIX v4: center LK action buttons + refine topbar + auth spacing ===== */

/* 1) Center "Найти ЛС по адресу" + "Привязать по номеру ЛС" */
#blockBind .lk-mode-buttons{
  justify-content: center !important;
  width: 100%;
}
#blockBind .lk-mode-buttons > button{
  margin: 0;
}

/* 2) Ensure payment action buttons are centered */
#blockPay .pay-actions{
  justify-content: center !important;
  width: 100%;
}

/* 3) Topbar title/logo proportions (desktop) */
.topbar{
  align-items: center;
}
.topbar .title{
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}
.topbar-logo{
  height: 44px; /* was too tall and pushed layout */
}

/* 4) Auth forms: add breathing room between last input and primary button */
#regStep1 .btn.primary,
#resetStep1 .btn.primary{
  margin-top: 12px;
}

/* Slightly calmer auth titles */
.card .title{
  font-size: 24px;
  font-weight: 700;
}
@media (max-width: 560px){
  .card .title{ font-size: 22px; }
  .topbar .title{ font-size: 16px; }
  .topbar-logo{ height: 34px; }
}



/* ===== Legal docs links (registration step 3) ===== */
.checkbox .legal-link{
  color: rgba(22,163,74,0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.checkbox .legal-link:hover{
  text-decoration-thickness: 2px;
}
/* ===== Cookie notice ===== */
.cookie{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  padding: 12px 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
  transform: translateY(110%);
  transition: transform .22s ease;
}
.cookie.is-open{ transform: translateY(0); }

.cookie__inner{
  max-width: var(--content, 720px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.cookie__text{
  font-size: 13px;
  line-height: 1.35;
  color: rgba(17,17,17,0.78);
}
.cookie__text a{
  color: rgba(22, 101, 52, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie__actions{ flex: 0 0 auto; }

/* mobile */
@media (max-width: 560px){
  .cookie__inner{
    flex-direction: column;
    align-items: stretch;
  }
  .cookie__actions .btn{
    width: 100%;
  }
}
.site-footer {
  margin-top: 24px;
  padding: 18px 12px;
  border-top: 1px solid rgba(20, 140, 60, 0.18);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(3px);
}

.site-footer__inner {
  max-width: 980px;          /* под ваш контент */
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 1fr;
  gap: 14px 18px;
  align-items: start;
}

.site-footer__title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.site-footer__text {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.9;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__links a {
  font-size: 13px;
  text-decoration: underline;
}

.nowrap { white-space: nowrap; }

@media (max-width: 820px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}




/* OTP actions spacing: add visual gap from input above */
.otp-actions{
  margin-top: 12px;
}

/* Put "Назад ко входу" link to bottom-right corner inside auth cards */
.card{
  position: relative;
}

.row-links--corner{
  position: absolute;
  right: 18px;
  bottom: 14px;
  margin: 0;
}

/* Ensure there is room for corner link */
#view-reset .card,
#view-register .card{
  padding-bottom: 56px;
}


/* ===== Payments loading overlay ===== */
.payments-area{
  position: relative;
  min-height: 120px;
}
.payments-loader{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  z-index: 5;
}
.payments-loader[hidden]{ display:none; }
.payments-list.is-hidden{ display:none; }

/* Spinner for overlay (not only inside buttons) */
.payments-loader .spinner{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ===== Footer account edit button ===== */
.site-footer__actions{
  margin-top: 10px;
}

.btn--footer-secondary{
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(17,17,17,0.72);
  background: #eef1f4;
  border: 1px solid rgba(0,0,0,0.08);
}

.btn--footer-secondary:hover{
  background: #e7ebef;
  color: rgba(17,17,17,0.86);
}

/* ===== Profile edit ===== */
#view-profile .card{
  max-width: 560px;
}

.profile-edit-actions{
  gap: 10px;
  margin-top: 12px;
}

#profileCurrentPhone[readonly],
#profileCurrentEmail[readonly]{
  background: rgba(0,0,0,0.03);
}

#profileOtpBlock{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

@media (max-width: 600px){
  .profile-edit-actions .btn,
  .site-footer__actions .btn{
    width: 100%;
    min-width: 100%;
  }
}

/* ===== Profile change mode ===== */
.profile-change-mode{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 16px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}

.profile-change-mode__item{
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: rgba(17,17,17,0.82);
}

.profile-change-mode__item input{
  width: auto;
  height: auto;
  margin: 0;
}

#profilePhoneBlock,
#profileEmailBlock{
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.pay-actions--secondary{
  margin-top: 10px;
}

.btn--partial-pay{
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(17,17,17,0.72);
  background: #eef1f4;
  border: 1px solid rgba(0,0,0,0.08);
}

.btn--partial-pay:hover{
  background: #e7ebef;
  color: rgba(17,17,17,0.86);
}

#partialPayPanel{
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}

.partial-pay-row{
  gap: 10px;
  align-items: center;
}

.partial-pay-row .input{
  flex: 1 1 auto;
  min-width: 220px;
}

@media (max-width: 600px){
  .partial-pay-row{
    flex-direction: column;
    align-items: stretch;
  }

  .partial-pay-row .input,
  .partial-pay-row .btn{
    width: 100%;
  }
}

.pay-note{
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(17,17,17,0.64);
}

.pay-note::before{
  content: "ℹ ";
}

.pay-note small{
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(17,17,17,0.58);
}