:root {
  --bg: #f3f4f8;
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #ffffff;
  --surface-2: #eef0f5;
  --text: #15171d;
  --muted: #6a7081;
  --border: #e1e4ec;
  --accent: #5b5bf0;
  --accent-text: #ffffff;
  --danger: #e5484d;
  --ok: #2fad4b;
  --shadow: 0 1px 2px rgba(16, 20, 40, .05), 0 8px 24px rgba(16, 20, 40, .06);
  --radius: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0e12;
  --surface: rgba(24, 26, 33, .86);
  --surface-solid: #181a21;
  --surface-2: #22252e;
  --text: #eceef4;
  --muted: #959bab;
  --border: #2b2e38;
  --accent: #7b7bff;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body {
  margin: 0; min-height: 100vh;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
img { max-width: 100%; }

/* Полупрозрачные обои — только фон, кнопки и карточки поверх */
.wall {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: center / cover no-repeat;
  opacity: var(--wall-op, .3);
}

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  backdrop-filter: blur(10px);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.sm svg { width: 16px; height: 16px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=number], input[type=password], input[type=url], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-solid); color: var(--text);
  font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; backdrop-filter: blur(12px);
}

.check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-solid);
}
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 1000; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); color: #fff; }

.theme-btn.floating { position: fixed; top: 16px; right: 16px; z-index: 50; }

/* ---------- кнопки соцсетей: всегда в своих фирменных цветах ---------- */
.sbtn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 58px; padding: 10px 18px; border-radius: 16px;
  color: #fff !important; text-decoration: none; font-weight: 650; font-size: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14); transition: transform .1s, filter .15s;
}
.sbtn:hover { filter: brightness(1.07); }
.sbtn:active { transform: scale(.98); }
.sbtn .ic { width: 26px; height: 26px; flex: none; display: inline-flex; }
.sbtn .ic svg { width: 100%; height: 100%; }
.sbtn .lbl { flex: 1; }
.sbtn .arr { opacity: .8; font-size: 22px; line-height: 1; }
.sbtn.t-tiktok { box-shadow: 0 6px 18px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255, 255, 255, .14); }

.net-chip {
  width: 36px; height: 36px; border-radius: 10px; color: #fff; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.net-chip svg { width: 20px; height: 20px; }

/* ---------- страница карточки клиента ---------- */
.cardpage { width: 100%; max-width: 440px; margin: 0 auto; padding: 72px 16px 40px; }
.cp-head { text-align: center; margin-bottom: 24px; }
.cp-logo {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 16px; overflow: hidden;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 700; color: var(--accent);
}
.cp-logo img { width: 100%; height: 100%; object-fit: cover; }
.cp-head h1 { font-size: 26px; }
.cp-head p { color: var(--muted); margin: 0; }
.cp-links { display: flex; flex-direction: column; gap: 12px; }
.cp-empty { text-align: center; color: var(--muted); padding: 30px 0; }
.cp-foot { text-align: center; margin-top: 32px; font-size: 12px; color: var(--muted); }
