/* ==========================================================================
   IdealAnketa — темы. Переопределяет ВСЁ. Не трогай style.css.
   !important намеренно: гарантирует победу над старыми правилами.
   ========================================================================== */

:root,
:root[data-theme="light-pink"] {
    --bg: #fff6f9; --bg-soft: #ffeaf0;
    --surface: #ffffff; --surface-2: #fff2f6; --surface-3: #ffe1ea;
    --border: #f2ced9; --border-strong: #e3b2c3;
    --text: #3d2434; --text-muted: #8a6f7e; --text-inverse: #ffffff;
    --accent: #e8395f; --accent-2: #ff6f92; --accent-soft: #ffe0e8; --accent-text: #ffffff;
    --ok: #22a85a; --warn: #e99418; --danger: #d62f4c;
    --shadow-sm: 0 2px 8px rgba(232,57,95,.08);
    --shadow: 0 8px 24px rgba(232,57,95,.12);
    --shadow-lg: 0 20px 52px rgba(232,57,95,.18);
    --radius: 16px; --radius-sm: 10px;
    --gradient: linear-gradient(135deg, #ff85a8 0%, #e8395f 100%);
    --gradient-soft: linear-gradient(135deg, #fff0f5 0%, #ffe0e8 100%);
}

:root[data-theme="light-lavender"] {
    --bg: #f8f6ff; --bg-soft: #f0edff;
    --surface: #ffffff; --surface-2: #f4f1ff; --surface-3: #e8e2ff;
    --border: #dad2fc; --border-strong: #c3b7f2;
    --text: #2b2547; --text-muted: #7a6fa0; --text-inverse: #ffffff;
    --accent: #6a5be8; --accent-2: #9b8dff; --accent-soft: #e7e2ff; --accent-text: #ffffff;
    --ok: #22a85a; --warn: #e99418; --danger: #d62f4c;
    --shadow-sm: 0 2px 8px rgba(106,91,232,.08);
    --shadow: 0 8px 24px rgba(106,91,232,.14);
    --shadow-lg: 0 20px 52px rgba(106,91,232,.20);
    --radius: 16px; --radius-sm: 10px;
    --gradient: linear-gradient(135deg, #9b8dff 0%, #6a5be8 100%);
    --gradient-soft: linear-gradient(135deg, #f4f1ff 0%, #e7e2ff 100%);
}

:root[data-theme="dark-violet"] {
    --bg: #13101a; --bg-soft: #1a1622;
    --surface: #221c2e; --surface-2: #2a2238; --surface-3: #342a45;
    --border: #382d4a; --border-strong: #4d3f63;
    --text: #f2ecff; --text-muted: #a89dbd; --text-inverse: #13101a;
    --accent: #a98bff; --accent-2: #c7b1ff; --accent-soft: #352865; --accent-text: #0f0c15;
    --ok: #5ee29a; --warn: #ffbf5c; --danger: #ff728a;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.35);
    --shadow: 0 8px 24px rgba(0,0,0,.45);
    --shadow-lg: 0 20px 52px rgba(0,0,0,.60);
    --radius: 16px; --radius-sm: 10px;
    --gradient: linear-gradient(135deg, #c7b1ff 0%, #a98bff 100%);
    --gradient-soft: linear-gradient(135deg, #2a2238 0%, #352865 100%);
}

:root[data-theme="dark-rose"] {
    --bg: #160d11; --bg-soft: #201318;
    --surface: #281a1f; --surface-2: #301f26; --surface-3: #3b262d;
    --border: #422a30; --border-strong: #5a3a43;
    --text: #fdeef2; --text-muted: #b89da6; --text-inverse: #0f0a0c;
    --accent: #ff7091; --accent-2: #ffa0b6; --accent-soft: #4a1f2a; --accent-text: #0f0a0c;
    --ok: #5ee29a; --warn: #ffbf5c; --danger: #ff728a;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.35);
    --shadow: 0 8px 24px rgba(0,0,0,.45);
    --shadow-lg: 0 20px 52px rgba(0,0,0,.60);
    --radius: 16px; --radius-sm: 10px;
    --gradient: linear-gradient(135deg, #ffa0b6 0%, #ff7091 100%);
    --gradient-soft: linear-gradient(135deg, #301f26 0%, #4a1f2a 100%);
}

/* ---------- База ---------- */
html, body {
    background: var(--bg) !important;
    color: var(--text) !important;
    transition: background .35s ease, color .35s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 { color: var(--text) !important; }
p, span, small, label, li, td, th, dt, dd { color: inherit; }
a { color: var(--accent) !important; transition: opacity .15s; }
a:hover { opacity: .8; }

/* ---------- Контейнеры / карточки ---------- */
.card,
.panel,
.box,
.tile,
.result,
.variant,
.style-card,
.stat,
.modal,
.dialog,
.sheet,
.tabs,
.tabset,
.list-item,
.dropdown,
.popover,
.tooltip,
.well,
.alert {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.card,
.panel,
.box,
.tile,
.result,
.variant,
.style-card,
.stat {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: box-shadow .25s ease, transform .15s ease;
}
.card:hover,
.tile:hover,
.style-card:hover,
.variant:hover {
    box-shadow: var(--shadow) !important;
}

/* ---------- Header / Footer ---------- */
.header,
.navbar,
.topbar,
.site-header,
header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    backdrop-filter: saturate(180%) blur(10px);
}
.footer,
.site-footer,
footer {
    background: var(--bg-soft) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
}

/* ---------- Кнопки ---------- */
button,
.btn{
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
    background: var(--gradient) !important;
    color: var(--accent-text) !important;
    border: 1px solid transparent !important;
    box-shadow: var(--shadow-sm);
}
button:hover:not(:disabled),
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow) !important; }
button:active:not(:disabled),
.btn:active:not(:disabled) { transform: translateY(0); }

.btn-ghost,
button.ghost,
button.secondary {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}
.btn-ghost:hover { background: var(--surface-3) !important; }

.btn-danger { background: var(--danger) !important; color: #fff !important; }
.btn-ok     { background: var(--ok) !important; color: #fff !important; }

button:disabled,
.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- Формы ---------- */
input,
textarea,
select {
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    padding: 11px 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder,
textarea::placeholder { color: var(--text-muted) !important; opacity: .7; }
input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
    background: var(--surface) !important;
}
label { color: var(--text-muted) !important; font-size: .9em; }

/* ---------- Бейджи, теги, табы ---------- */
.badge,
.tag,
.chip,
.pill {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    border: 1px solid var(--border) !important;
    border-radius: 999px !important;
    padding: 3px 10px;
    font-size: .8em;
    font-weight: 600;
}
.badge.ok,
.badge.success,
.tag.ok { background: rgba(34,168,90,.14) !important; color: var(--ok) !important; }
.badge.warn { background: rgba(233,148,24,.14) !important; color: var(--warn) !important; }
.badge.danger,
.badge.error { background: rgba(214,47,76,.14) !important; color: var(--danger) !important; }

.tabs,
.tabset {
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    border-radius: var(--radius-sm) !important;
    padding: 4px;
}
.tab {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: 0 !important;
    border-radius: calc(var(--radius-sm) - 2px) !important;
    box-shadow: none;
}
.tab:hover { background: var(--surface-2) !important; }
.tab.active {
    background: var(--gradient) !important;
    color: var(--accent-text) !important;
}

/* ---------- Алерты / тосты ---------- */
.alert,
.toast { border-radius: var(--radius-sm) !important; border-left-width: 3px !important; }
.alert-ok,
.alert.success { background: rgba(34,168,90,.10) !important; border-color: rgba(34,168,90,.4) !important; color: var(--ok) !important; }
.alert-warn { background: rgba(233,148,24,.10) !important; border-color: rgba(233,148,24,.4) !important; color: var(--warn) !important; }
.alert-error,
.alert.danger { background: rgba(214,47,76,.10) !important; border-color: rgba(214,47,76,.4) !important; color: var(--danger) !important; }

/* ---------- Модалки ---------- */
.modal-overlay,
.overlay {
    background: rgba(0,0,0,.45) !important;
    backdrop-filter: blur(4px);
}
.modal,
.dialog {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    color: var(--text) !important;
}

/* ---------- Таблицы ---------- */
table { color: var(--text) !important; }
thead th {
    color: var(--text-muted) !important;
    border-bottom: 1px solid var(--border) !important;
    font-weight: 600;
    font-size: .85em;
    text-transform: uppercase;
    letter-spacing: .04em;
}
tbody tr { border-bottom: 1px solid var(--border) !important; transition: background .12s; }
tbody tr:hover { background: var(--surface-2) !important; }

/* ---------- Спиннер / скелетон ---------- */
.spinner,
.loader {
    border: 2px solid var(--border) !important;
    border-top-color: var(--accent) !important;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---------- Свитчер тем ---------- */
.theme-switcher {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}
.theme-dot {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid transparent !important;
    padding: 0; cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    box-shadow: none !important;
}
.theme-dot:hover { transform: scale(1.12); }
.theme-dot.is-active {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
.theme-dot--light-pink      { background: linear-gradient(135deg, #ff85a8, #e8395f) !important; }
.theme-dot--light-lavender  { background: linear-gradient(135deg, #9b8dff, #6a5be8) !important; }
.theme-dot--dark-violet     { background: linear-gradient(135deg, #3c3155, #a98bff) !important; }
.theme-dot--dark-rose       { background: linear-gradient(135deg, #4a2530, #ff7091) !important; }

/* ---------- Плавное переключение ---------- */
*, *::before, *::after {
    transition-property: background-color, border-color, color, box-shadow;
    transition-duration: .25s;
    transition-timing-function: ease;
}
body.no-transition * { transition: none !important; }