/*
Theme Name: Guardar Theme
Theme URI:
Author: Tenpix
Author URI:
Description: Тема Guardar — нейронная видеоаналитика. Лендинг и личный кабинет (тёмная/светлая тема).
Version: 2.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: guardar-theme
Tags: dark, light, minimal, dashboard
*/

/* =========================================================
   0. ПЕРЕМЕННЫЕ
   ========================================================= */

:root,
[data-theme="dark"] {
    color-scheme: dark;

    --gd-bg: #0a0e13;
    --gd-bg-dot: #171f28;
    --gd-surface: #101720;
    --gd-surface-2: #12191f;
    --gd-surface-3: #151d27;
    --gd-border: #1e2731;
    --gd-border-2: #232c35;
    --gd-border-3: #2c3742;
    --gd-header-border: #1b232c;
    --gd-header-bg: rgba(10, 14, 19, .82);
    --gd-overlay: rgba(5, 7, 10, .7);

    --gd-text: #e7ecf1;
    --gd-text-muted: #a7b1bc;
    --gd-text-dim: #8f9aa6;
    --gd-text-dimmer: #7b8794;
    --gd-text-faint: #5c6672;

    --gd-accent: rgb(66, 118, 232);
    --gd-accent-light: rgb(115, 161, 244);
    --gd-accent-lighter: rgb(135, 179, 248);
    --gd-accent-soft: rgba(66, 118, 232, .14);
    --gd-accent-border: rgba(66, 118, 232, .3);

    --gd-danger: #e5484d;
    --gd-warning: #e6a23c;
    --gd-success: rgb(66, 118, 232);
    --gd-danger-text: #ff8b8e;
    --gd-warning-text: #f0b95c;

    --gd-radius-sm: 8px;
    --gd-radius: 10px;
    --gd-radius-lg: 14px;
    --gd-radius-xl: 22px;

    --gd-font: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --gd-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

[data-theme="light"] {
    color-scheme: light;

    --gd-bg: #f3f5f8;
    --gd-bg-dot: #d7dde6;
    --gd-surface: #ffffff;
    --gd-surface-2: #eef1f6;
    --gd-surface-3: #e6ebf2;
    --gd-border: #e1e6ee;
    --gd-border-2: #d4dbe5;
    --gd-border-3: #c3ccd8;
    --gd-header-border: #e1e6ee;
    --gd-header-bg: rgba(243, 245, 248, .88);
    --gd-overlay: rgba(18, 24, 34, .48);

    --gd-text: #151b24;
    --gd-text-muted: #4a5568;
    --gd-text-dim: #5a6474;
    --gd-text-dimmer: #6b7585;
    --gd-text-faint: #8a94a3;

    --gd-accent: rgb(66, 118, 232);
    --gd-accent-light: rgb(56, 105, 209);
    --gd-accent-lighter: rgb(46, 90, 190);
    --gd-accent-soft: rgba(66, 118, 232, .10);
    --gd-accent-border: rgba(66, 118, 232, .28);

    --gd-danger: #d64545;
    --gd-warning: #c98a2e;
    --gd-success: rgb(66, 118, 232);
    --gd-danger-text: #c0393c;
    --gd-warning-text: #a56b14;
}

/* Личный кабинет использует свою типографику; лендинг остаётся на Manrope. */
body.gd-dash-page {
    --gd-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --gd-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    -moz-osx-font-smoothing: grayscale;
    font-optical-sizing: auto;
}

/* У Inter насыщенность 800 заметно плотнее, чем у Manrope, поэтому в кабинете
   держим шкалу 600 (заголовки) / 700 (числовые акценты). */
body.gd-dash-page h1,
body.gd-dash-page h2,
body.gd-dash-page h3,
body.gd-dash-page h4,
body.gd-dash-page h5 {
    font-weight: 600;
    letter-spacing: -.006em;
}
body.gd-dash-page .gd-dash-topbar h1 { font-weight: 600; }

/* Переключатель темы делит стиль с лендингом, где он остаётся моноширинным. */
body.gd-dash-page .gd-theme-toggle { font-family: var(--gd-font); }

/* =========================================================
   1. БАЗА
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--gd-bg);
    background-image: radial-gradient(circle, var(--gd-bg-dot) 1px, transparent 1px);
    background-size: 26px 26px;
    color: var(--gd-text);
    font-family: var(--gd-font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.gd-no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }

a { color: var(--gd-accent); text-decoration: none; }
a:hover { color: var(--gd-accent-light); }

::selection { background: rgba(66, 118, 232, .35); }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 800; letter-spacing: -.01em; }

p { margin: 0; }

button { font-family: inherit; }

input, textarea, select {
    font-family: var(--gd-font);
    background: var(--gd-bg);
    border: 1px solid var(--gd-border-2);
    border-radius: 9px;
    padding: 12px 14px;
    color: var(--gd-text);
    font-size: 14px;
    outline: none;
    width: 100%;
    transition: border-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--gd-text-faint); }
input:focus, textarea:focus, select:focus { border-color: var(--gd-accent); }
textarea { resize: vertical; font-family: inherit; }

.gd-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 48px;
}

@keyframes gdPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes gdFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* Те же кадры, но с масштабированием — для .gd-hero-visual-stage на мобильных/планшетах.
   Нельзя просто добавить transform:scale() рядом с animation на одном элементе:
   кадры анимации полностью заменяют transform, поэтому scale «пропадает».
   (Пробовали считать scale через calc(var()/460px) с процентами — в контексте
   transform это невалидно и блок почти пропадал, поэтому используем фиксированные шаги.) */
@keyframes gdFloatScale85 { 0%, 100% { transform: scale(.85) translateY(0); } 50% { transform: scale(.85) translateY(-10px); } }
@keyframes gdFloatScale78 { 0%, 100% { transform: scale(.78) translateY(0); } 50% { transform: scale(.78) translateY(-10px); } }
@keyframes gdFloatScale70 { 0%, 100% { transform: scale(.7) translateY(0); } 50% { transform: scale(.7) translateY(-10px); } }
@keyframes gdFloatScale63 { 0%, 100% { transform: scale(.63) translateY(0); } 50% { transform: scale(.63) translateY(-10px); } }
@keyframes gdFloatScale56 { 0%, 100% { transform: scale(.56) translateY(0); } 50% { transform: scale(.56) translateY(-10px); } }
@keyframes gdSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes gdBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes gdGlow { 0%, 100% { opacity: .5; } 50% { opacity: .85; } }
@keyframes gdFloatCard { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-6px) rotate(var(--r, 0deg)); } }
@keyframes gdBar { 0%, 100% { transform: scaleY(.8); opacity: .7; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes gdRunDot { 0% { left: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: calc(100% - 5px); opacity: 0; } }
@keyframes gdAlertGlow {
    0%, 100% { box-shadow: 0 16px 34px -8px rgba(56, 105, 209, .35), 0 0 0 1px rgba(66, 118, 232, .15); }
    50% { box-shadow: 0 16px 34px -8px rgba(56, 105, 209, .55), 0 0 0 1px rgba(66, 118, 232, .3); }
}

/* =========================================================
   2. КНОПКИ
   ========================================================= */

.gd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: var(--gd-radius);
    padding: 13px 24px;
    cursor: pointer;
    border: none;
    transition: border-color .15s ease, opacity .15s ease, transform .05s ease;
    white-space: nowrap;
}
.gd-btn:active { transform: scale(.98); }
.gd-btn:disabled { opacity: .55; cursor: not-allowed; }

.gd-btn-primary {
    background: var(--gd-accent);
    color: #fff;
    box-shadow: 0 0 0 1px var(--gd-accent-border), 0 10px 30px -8px rgba(56, 105, 209, .5);
}
.gd-btn-primary:hover { color: #fff; background: var(--gd-accent-light); }

.gd-btn-outline {
    background: transparent;
    color: var(--gd-text);
    border: 1px solid var(--gd-border-3);
}
.gd-btn-outline:hover { color: var(--gd-text); border-color: rgba(66, 118, 232, .6); }

.gd-btn-ghost {
    background: transparent;
    color: var(--gd-text-dim);
    border: none;
    padding: 9px 16px;
    font-size: 13.5px;
}
.gd-btn-ghost:hover { color: var(--gd-text); }

.gd-btn-danger {
    background: transparent;
    color: var(--gd-danger);
    border: 1px solid rgba(229, 72, 77, .4);
}
.gd-btn-danger:hover { color: #fff; background: var(--gd-danger); }

.gd-btn-sm { padding: 8px 14px; font-size: 13px; }

/* =========================================================
   3. ШАПКА
   ========================================================= */

.gd-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 48px;
    background: var(--gd-header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gd-header-border);
}

.gd-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gd-text);
}
.gd-logo img { width: 100%; }
.gd-logo-img--light { display: none; }
[data-theme="light"] .gd-logo-img--dark { display: none; }
[data-theme="light"] .gd-logo-img--light { display: block; }
.gd-logo span {
    font-family: var(--gd-mono);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .06em;
}

.gd-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}
.gd-nav a.gd-nav-link {
    font-size: 14px;
    color: var(--gd-text-muted);
}
.gd-nav a.gd-nav-link:hover { color: var(--gd-text); }
.gd-nav button.gd-nav-link {
    font-size: 14px;
    color: var(--gd-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.gd-nav button.gd-nav-link:hover { color: var(--gd-text); }

/* =========================================================
   4. ГЕРОЙ / ЛЕНДИНГ
   ========================================================= */

.gd-hero {
    position: relative;
    padding: 110px 48px 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    max-width: 1360px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.gd-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--gd-mono);
    font-size: 11.5px;
    letter-spacing: .08em;
    color: var(--gd-text-dimmer);
    background: var(--gd-surface-2);
    border: 1px solid var(--gd-border-2);
    border-radius: 20px;
    padding: 6px 13px;
    margin-bottom: 24px;
}
.gd-badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--gd-accent);
    animation: gdPulse 1.8s ease-in-out infinite;
}

.gd-hero h1 {
    font-size: 52px;
    line-height: 1.1;
    margin-bottom: 20px;
    max-width: 620px;
}
.gd-hero h1 .accent { color: var(--gd-accent); }

.gd-hero p.gd-lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--gd-text-muted);
    max-width: 520px;
    margin-bottom: 32px;
}

.gd-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.gd-hero-visual {
    flex: 0 0 460px;
    max-width: 100%;
    height: 420px;
    position: relative;
}
.gd-hero-visual-stage {
    width: 460px;
    height: 420px;
    position: relative;
    animation: gdFloat 6s ease-in-out infinite;
}
.gd-hero-visual .glow {
    position: absolute; inset: 30px;
    background: rgba(56, 105, 209, .12);
    filter: blur(60px);
}
.gd-hero-visual svg.gd-connectors { position: absolute; inset: 0; overflow: visible; }

.gd-hero-eye {
    position: absolute;
    left: 14px; top: 186px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--gd-surface);
    border: 1px solid rgba(66, 118, 232, .5);
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}
.gd-hero-eye .ring {
    position: absolute; inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(66, 118, 232, .35);
    animation: gdGlow 3s ease-in-out infinite;
}

.gd-hero-card {
    position: absolute;
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: 13px;
    padding: 14px 16px;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .5);
    animation: gdFloatCard 5.5s ease-in-out infinite;
}
.gd-hero-card .tag {
    font-family: var(--gd-mono);
    font-size: 10.5px;
    letter-spacing: .07em;
    color: var(--gd-text-dimmer);
    margin-bottom: 10px;
}
.gd-hero-card.alert {
    border-color: rgba(66, 118, 232, .55);
    background: var(--gd-surface-3);
    z-index: 2;
    animation: gdFloatCard 6.5s ease-in-out infinite .3s, gdAlertGlow 3s ease-in-out infinite;
}
.gd-hero-card.alert .tag { color: rgb(90, 138, 238); margin-bottom: 0; }
.gd-hero-card .bars { display: flex; align-items: flex-end; gap: 5px; height: 34px; margin-bottom: 10px; }
.gd-hero-card .bars span { width: 9px; border-radius: 2px; background: var(--gd-border-3); display: block; transform-origin: bottom; }
.gd-hero-card .bars span.on { background: var(--gd-accent); animation: gdBar 2.2s ease-in-out infinite; }
.gd-hero-card .note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--gd-text-dim); }
.gd-hero-card .note .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gd-accent); animation: gdPulse 1.6s ease-in-out infinite; }
.gd-hero-card .runline { flex: 1; height: 1px; background: var(--gd-border-3); position: relative; }
.gd-hero-card .runline .run-dot {
    position: absolute; left: 0; top: -2px;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--gd-accent);
    animation: gdRunDot 2.4s linear infinite;
}

@media (max-width: 960px) {
    .gd-hero-visual { width: 391px; height: 357px; flex-basis: auto; margin: 0 auto 10px; overflow: hidden; }
    .gd-hero-visual-stage { animation: gdFloatScale85 6s ease-in-out infinite; transform-origin: top left; }
    .gd-hero-visual .glow { background: none; }
}

/* =========================================================
   5. КОНТАКТНАЯ СЕКЦИЯ
   ========================================================= */

.gd-contact {
    padding: 70px 48px 130px;
    max-width: 1000px;
    margin: 0 auto;
}
.gd-contact-panel {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius-xl);
    padding: 56px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    position: relative;
    overflow: hidden;
}
.gd-contact-panel::before {
    content: '';
    position: absolute; top: -80px; right: -80px;
    width: 220px; height: 220px; border-radius: 50%;
    background: rgba(56, 105, 209, .10);
    filter: blur(40px);
}
.gd-contact-kicker {
    font-family: var(--gd-mono);
    font-size: 12px;
    letter-spacing: .1em;
    color: var(--gd-accent);
    margin-bottom: 12px;
}
.gd-contact h2 { font-size: 28px; margin-bottom: 16px; }
.gd-contact-panel .desc { font-size: 15px; color: var(--gd-text-muted); line-height: 1.65; margin-bottom: 26px; }
.gd-contact-details { display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--gd-text-muted); }
.gd-contact-details .row { display: flex; gap: 10px; align-items: center; }
.gd-contact-details .label { color: var(--gd-text-faint); font-family: var(--gd-mono); font-size: 12px; width: 70px; flex-shrink: 0; }

.gd-form { display: flex; flex-direction: column; gap: 13px; position: relative; z-index: 1; }
.gd-form-message {
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 13.5px;
    display: none;
}
.gd-form-message.show { display: block; }
.gd-form-message.error { background: rgba(229, 72, 77, .12); color: var(--gd-danger-text); border: 1px solid rgba(229, 72, 77, .3); }
.gd-form-message.success { background: var(--gd-accent-soft); color: var(--gd-accent-lighter); border: 1px solid var(--gd-accent-border); }

.gd-success-block { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; position: relative; z-index: 1; }
.gd-success-icon {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--gd-accent-soft);
    display: flex; align-items: center; justify-content: center;
}

/* =========================================================
   6. ПОДВАЛ
   ========================================================= */

.gd-footer {
    border-top: 1px solid var(--gd-header-border);
    padding: 26px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1360px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 12px;
}
/* .mono — для данных: даты, суммы, домены, IP, коды.
   .gd-label — для служебных подписей и капслока, где моноширинность ломает кириллицу. */
.mono { font-family: var(--gd-mono); }
.gd-label {
    font-family: var(--gd-font);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gd-text-faint);
}
.gd-footer .mono, .gd-footer .gd-label { font-size: 12px; color: var(--gd-text-faint); }
.gd-footer .status { display: flex; align-items: center; gap: 8px; }
.gd-footer .status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gd-accent); animation: gdPulse 2s ease-in-out infinite; }
.gd-footer .recaptcha-note {
    flex-basis: 100%;
    text-align: center;
    font-size: 11px;
    color: var(--gd-text-faint);
    order: 10;
}
.gd-footer .recaptcha-note a { color: var(--gd-text-faint); text-decoration: underline; }
.gd-footer .recaptcha-note a:hover { color: var(--gd-text-dim); }

.gd-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--gd-border-2);
    background: var(--gd-surface);
    color: var(--gd-text-dim);
    font-family: var(--gd-mono);
    font-size: 11.5px;
    letter-spacing: .04em;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.gd-theme-toggle:hover {
    color: var(--gd-text);
    border-color: var(--gd-accent-border);
}
.gd-theme-toggle i { font-size: 12px; width: 1em; text-align: center; }
.gd-theme-toggle [data-gd-theme-icon-light] { display: none; }
[data-theme="light"] .gd-theme-toggle [data-gd-theme-icon-dark] { display: none; }
[data-theme="light"] .gd-theme-toggle [data-gd-theme-icon-light] { display: inline-block; }

/* Прячем стандартный виджет-бейдж reCAPTCHA (визуально) — вместо него в подвале
   выводится обязательный по правилам Google текст со ссылками на политику. */
.grecaptcha-badge { visibility: hidden !important; }

/* =========================================================
   7. МОДАЛЬНОЕ ОКНО / ВХОД / РЕГИСТРАЦИЯ
   ========================================================= */

.gd-modal-overlay {
    position: fixed; inset: 0;
    background: var(--gd-overlay);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.gd-modal-overlay.open { display: flex; }

.gd-modal {
    width: 100%; max-width: 440px;
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: 18px;
    padding: 52px 32px 32px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.gd-modal-close {
    position: absolute; top: 16px; right: 16px;
    z-index: 5;
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid var(--gd-border-2);
    background: var(--gd-surface);
    color: var(--gd-text-dim);
    cursor: pointer;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.gd-modal-close:hover { color: var(--gd-text); border-color: var(--gd-accent-border); }

.gd-tabs {
    display: flex; gap: 4px;
    background: var(--gd-bg);
    border: 1px solid var(--gd-border-2);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 24px;
}
.gd-tab {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 10px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--gd-text-dimmer);
    font-family: inherit;
}
.gd-tab.active { background: var(--gd-accent); color: #fff; }

.gd-modal-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--gd-accent-soft);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
}
.gd-modal h1 { font-size: 20px; margin-bottom: 8px; }
.gd-modal .sub { font-size: 13.5px; color: var(--gd-text-dim); line-height: 1.5; margin-bottom: 22px; }
.gd-gate-message {
    background: var(--gd-surface-3);
    border: 1px solid var(--gd-border-2);
    border-radius: 10px;
    padding: 16px;
    font-size: 13.5px;
    color: var(--gd-text-muted);
    line-height: 1.6;
}
.gd-panel { display: none; }
.gd-panel.active { display: block; }

/* =========================================================
   8. КАРТОЧКИ / АЛЕРТЫ / БЕЙДЖИ (личный кабинет)
   ========================================================= */

.gd-card {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius-lg);
    margin-bottom: 16px;
}
.gd-card:last-child { margin-bottom: 0; }
.gd-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.gd-card-header h2 { font-size: 17px; }
.gd-card-body { padding: 24px; }

.gd-alert {
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 13.5px;
    display: none;
    margin-bottom: 16px;
}
.gd-alert.show { display: block; }
.gd-alert-warning { background: rgba(230, 162, 60, .12); color: var(--gd-warning-text); border: 1px solid rgba(230, 162, 60, .3); }
.gd-alert-danger { background: rgba(229, 72, 77, .12); color: var(--gd-danger-text); border: 1px solid rgba(229, 72, 77, .3); }
.gd-alert-success { background: var(--gd-accent-soft); color: var(--gd-accent-lighter); border: 1px solid var(--gd-accent-border); }

.gd-badge-pill {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.gd-badge-pending { background: rgba(230, 162, 60, .15); color: var(--gd-warning-text); }
.gd-badge-accepted, .gd-badge-processing { background: var(--gd-accent-soft); color: var(--gd-accent-lighter); }
.gd-badge-rejected { background: rgba(229, 72, 77, .15); color: var(--gd-danger-text); }
.gd-badge-ready { background: rgba(66, 118, 232, .2); color: var(--gd-accent-lighter); }

.gd-badge-spinner {
    width: 9px; height: 9px;
    margin-right: 6px;
    flex: 0 0 auto;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: .85;
    animation: gdSpin .7s linear infinite;
}

.gd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gd-table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--gd-text-faint);
    padding: 0 12px 12px;
    border-bottom: 1px solid var(--gd-border);
}
.gd-table td { padding: 14px 12px; border-bottom: 1px solid var(--gd-border); vertical-align: middle; }
.gd-table tr:last-child td { border-bottom: none; }

.gd-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gd-text-dimmer);
}
.gd-empty-state svg { margin-bottom: 12px; opacity: .6; }

/* Карточки экземпляров (личный кабинет) */
.gd-instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.gd-instance-card {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color .3s, box-shadow .3s;
}
.gd-instance-card.is-transitional {
    border-color: var(--gd-accent-border);
    animation: gdCardPulse 1.8s ease-in-out infinite;
}
@keyframes gdCardPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--gd-accent-soft); }
    50% { box-shadow: 0 0 0 5px var(--gd-accent-soft); }
}
.gd-instance-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gd-instance-card-name { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 15px; font-weight: 700; }
.gd-instance-card-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-instance-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--gd-border-3); }
.gd-instance-dot-active { background: var(--gd-accent); }
.gd-instance-dot-pulse { background: var(--gd-accent); animation: gdPulse 1s ease-in-out infinite; }
.gd-instance-card-link {
    display: block;
    font-family: var(--gd-mono);
    font-size: 12px;
    color: var(--gd-text-dim);
    word-break: break-all;
}
.gd-instance-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--gd-text-dim);
    padding-top: 12px;
    border-top: 1px solid var(--gd-border);
}
.gd-instance-card-meta strong { color: var(--gd-text); font-variant-numeric: tabular-nums; }
.gd-instance-card-actions { display: flex; gap: 8px; margin-top: auto; }
.gd-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    flex: 0 0 auto;
    background: var(--gd-surface-2);
    border: 1px solid var(--gd-border-2);
    border-radius: 8px;
    color: var(--gd-text-dim);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s;
}
.gd-icon-btn:hover { color: var(--gd-text); border-color: var(--gd-accent-border); }
.gd-icon-btn.active { color: var(--gd-accent-lighter); border-color: var(--gd-accent-border); background: var(--gd-accent-soft); }
.gd-icon-btn:disabled, .gd-icon-btn.disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}
.gd-icon-btn-danger:hover { color: #fff; background: var(--gd-danger); border-color: var(--gd-danger); }

.gd-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px 20px;
}
.gd-info-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gd-info-label { font-size: 11.5px; color: var(--gd-text-faint); text-transform: uppercase; letter-spacing: .04em; }
.gd-info-value { font-size: 14px; color: var(--gd-text); word-break: break-word; }
.gd-secret-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}
.gd-secret-input {
    width: min(220px, 100%);
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--gd-border-2);
    background: var(--gd-bg);
    color: var(--gd-text);
    font-family: var(--gd-mono);
    font-size: 13px;
    letter-spacing: .08em;
}
.gd-secret-row .gd-icon-btn { width: 34px; height: 34px; flex: 0 0 auto; }
.gd-secret-row .gd-icon-btn.is-copied {
    color: var(--gd-accent-lighter);
    border-color: var(--gd-accent-border);
    background: var(--gd-accent-soft);
}

.gd-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 400;
}
.gd-toast {
    background: var(--gd-surface-3);
    border: 1px solid var(--gd-border-2);
    color: var(--gd-text);
    font-size: 13px;
    font-weight: 600;
    padding: 13px 16px;
    border-radius: 8px;
    box-shadow: 0 16px 32px -14px rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: gdToastIn .18s ease-out;
    max-width: 320px;
}
.gd-toast.error { border-color: rgba(229, 72, 77, .4); }
.gd-toast i { flex: 0 0 auto; color: var(--gd-accent-lighter); }
.gd-toast.error i { color: var(--gd-danger-text); }
@keyframes gdToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.gd-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gdSpin .7s linear infinite;
    display: inline-block;
}

/* =========================================================
   9. ЛИЧНЫЙ КАБИНЕТ — ЛЭЙАУТ
   ========================================================= */

.gd-dashboard { padding: 48px; max-width: 1200px; margin: 0 auto; }
.gd-dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}
.gd-dashboard-head h1 { font-size: 24px; }
.gd-dashboard-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gd-count-info { font-size: 13px; color: var(--gd-text-dim); }
.gd-count-info strong { color: var(--gd-text); }
.gd-count-info.limit strong { color: var(--gd-danger); }

.gd-checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.gd-checkbox-row {
    display: block;
    font-size: 14px;
    color: var(--gd-text-muted);
}
.gd-checkbox-row input { width: auto; margin-top: 3px; accent-color: var(--gd-accent); }
.gd-checkbox-row.disabled { color: var(--gd-text-faint); }
.gd-soon {
    font-size: 10.5px;
    background: var(--gd-surface-2);
    border: 1px solid var(--gd-border-2);
    color: var(--gd-text-faint);
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

.gd-field-group { display: flex; flex-direction: column; gap: 6px; }
.gd-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.gd-field-group label { font-size: 13px; color: var(--gd-text-dim); }
.gd-input-suffix { display: flex; align-items: stretch; }
.gd-input-suffix input { border-radius: 9px 0 0 9px; }
.gd-input-suffix span {
    display: flex; align-items: center;
    padding: 0 14px;
    background: var(--gd-surface-2);
    border: 1px solid var(--gd-border-2);
    border-left: none;
    border-radius: 0 9px 9px 0;
    font-size: 13px;
    color: var(--gd-text-dim);
    white-space: nowrap;
}
.gd-hint { font-size: 12px; color: var(--gd-text-faint); }

.gd-form-note {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--gd-text-dim);
    background: var(--gd-surface-2);
    border: 1px solid var(--gd-border);
    border-radius: 8px;
    padding: 12px 14px;
}

/* --- Кабинет клиента: сайдбар-лейаут (см. layouts/dashboard.blade.php) --- */

.gd-dash-shell { display: flex; min-height: 100vh; align-items: stretch; }

.gd-dash-sidebar {
    width: 240px;
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px;
    background: var(--gd-surface);
    border-right: 1px solid var(--gd-header-border);
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
}
.gd-dash-logo { display: flex; align-items: center; padding: 0 6px 4px; }
.gd-dash-logo img { width: 120px; }

.gd-dash-nav { display: flex; flex-direction: column; gap: 2px; }
.gd-dash-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--gd-text-muted);
    font-size: 13.5px;
    font-weight: 600;
}
.gd-dash-nav a i { width: 16px; text-align: center; font-size: 13px; }
.gd-dash-nav a:hover { background: var(--gd-surface-2); color: var(--gd-text); }
.gd-dash-nav a.active { background: var(--gd-accent-soft); color: var(--gd-accent-lighter); }

.gd-dash-sidebar-footer {
    margin-top: auto;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 6px;
    border-top: 1px solid var(--gd-header-border);
}
.gd-dash-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 9px;
    background: var(--gd-accent-soft);
    border: 1px solid var(--gd-accent-border);
    color: var(--gd-accent-lighter);
    font-size: 12px; font-weight: 600;
    letter-spacing: .02em;
}
.gd-dash-user-info { min-width: 0; }
.gd-dash-user-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-dash-user-email { font-size: 11.5px; color: var(--gd-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gd-dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.gd-dash-topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px;
    height: 64px;
    padding: 0 32px;
    background: var(--gd-header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gd-header-border);
}
.gd-dash-topbar h1 { font-size: 16px; font-weight: 700; margin: 0; }
.gd-dash-topbar-actions { display: flex; align-items: center; gap: 10px; }

.gd-dash-balance-chip {
    display: flex; align-items: center; gap: 9px;
    height: 36px; padding: 0 14px;
    border: 1px solid var(--gd-border-2);
    border-radius: 8px;
    background: var(--gd-surface);
    white-space: nowrap;
}
.gd-dash-balance-chip .gd-label { font-size: 10.5px; letter-spacing: .08em; }
.gd-dash-balance-chip strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }

.gd-dash-content { flex: 1; padding: 28px 32px 56px; }

.gd-dash-panel { display: none; }
.gd-dash-panel.active { display: block; }

.gd-dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.gd-dash-stat {
    background: var(--gd-surface);
    border: 1px solid var(--gd-border);
    border-radius: var(--gd-radius);
    padding: 18px 20px;
}
.gd-dash-stat-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: var(--gd-text-faint); margin-bottom: 10px; }
.gd-dash-stat-val { font-size: 24px; font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }

.gd-card-header-mono {
    padding: 0 24px;
    height: 46px;
    display: flex; align-items: center;
    border-bottom: 1px solid var(--gd-border);
    font-family: var(--gd-font);
    font-size: 11.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gd-text-faint);
    font-weight: 600;
}

.gd-dash-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.gd-dash-settings-grid .gd-card { margin-bottom: 0; }

.gd-tx-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 50%;
    font-size: 11px;
}
.gd-tx-icon-topup { background: var(--gd-accent-soft); color: var(--gd-accent-lighter); }
.gd-tx-icon-charge { background: rgba(229, 72, 77, .15); color: var(--gd-danger-text); }
.gd-tx-icon-adjustment { background: var(--gd-surface-2); color: var(--gd-text-dim); }

.gd-journal-dot {
    display: inline-block;
    width: 6px; height: 6px; flex: 0 0 auto;
    border-radius: 50%;
    background: var(--gd-border-2);
}
.gd-journal-dot-auth { background: var(--gd-accent); }

.gd-spend-chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.gd-spend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.gd-spend-bar { width: 100%; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--gd-accent-border); }
.gd-spend-bar.gd-spend-bar-peak { background: var(--gd-accent); }
.gd-spend-labels { display: flex; gap: 6px; border-top: 1px solid var(--gd-border); padding-top: 8px; margin-top: 12px; }
.gd-spend-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--gd-text-faint); font-family: var(--gd-mono); }

.gd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--gd-border);
}

.gd-modal.gd-modal-wide { max-width: 560px; }
.gd-modal.gd-modal-xl { max-width: 680px; }

/* =========================================================
   10. АДАПТИВНОСТЬ
   ========================================================= */

@media (max-width: 960px) {
    .gd-container { padding: 0 24px; }
    .gd-header { padding: 16px 24px; }
    .gd-nav { gap: 16px; }
    .gd-hero { padding: 90px 24px 70px; flex-direction: column; align-items: flex-start; }
    .gd-hero-visual { order: -1; align-self: center; }
    .gd-hero h1 { font-size: 38px; }
    .gd-contact { padding: 50px 24px 80px; }
    .gd-contact-panel { grid-template-columns: 1fr; padding: 32px 24px; }
    .gd-footer { padding: 20px 24px; justify-content: center; text-align: center; }
    .gd-dashboard { padding: 24px; }

    /* Кабинет клиента: сайдбар сворачивается в горизонтальную полосу сверху */
    .gd-dash-shell { flex-direction: column; }
    .gd-dash-sidebar {
        width: 100%; flex: 0 0 auto;
        height: auto; position: static;
        flex-direction: row; align-items: center;
        gap: 14px;
        padding: 12px 16px;
        overflow-x: auto;
    }
    .gd-dash-logo { padding: 0; flex-shrink: 0; }
    .gd-dash-logo img { width: 90px; }
    .gd-dash-nav { flex-direction: row; gap: 4px; flex-shrink: 0; }
    .gd-dash-nav a { padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
    .gd-dash-sidebar-footer { margin-top: 0; margin-left: auto; border-top: none; flex-shrink: 0; }
    .gd-dash-user-info { display: none; }
    .gd-dash-sidebar > .gd-btn, .gd-dash-sidebar > form { flex-shrink: 0; width: auto; }
    .gd-dash-sidebar .gd-dash-btn-label { display: none; }
    .gd-dash-topbar { padding: 0 16px; }
    .gd-dash-content { padding: 20px 16px 40px; }
}

@media (max-width: 600px) {
    body { overflow-x: hidden; }

    /* Шапка: логотип и «Демо»/«Вход» в одну строку, кнопку CTA прячем */
    .gd-header { padding: 12px 16px; }
    .gd-logo img { width: 120px; height: auto; }
    .gd-nav { gap: 14px; }
    .gd-nav a.gd-nav-link, .gd-nav button.gd-nav-link { font-size: 13px; }
    .gd-nav-cta { display: none; }

    /* Герой */
    .gd-hero { padding: 32px 16px 40px; gap: 30px; }
    .gd-hero h1 { font-size: 26px; margin-bottom: 14px; }
    .gd-hero p.gd-lead { font-size: 14.5px; margin-bottom: 24px; }
    .gd-hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .gd-hero-actions .gd-btn { width: 100%; }
    .gd-hero-visual { width: 359px; height: 328px; margin: 0 auto 10px; }
    .gd-hero-visual-stage { animation: gdFloatScale78 6s ease-in-out infinite; }

    /* Контейнер общих страниц */
    .gd-container { padding: 0 16px; }

    /* Контактная секция */
    .gd-contact { padding: 36px 16px 56px; }
    .gd-contact-panel { padding: 24px 18px; border-radius: 16px; }
    .gd-contact h2 { font-size: 22px; }
    .gd-contact-details .label { width: 60px; font-size: 11px; }
    .gd-contact-details { font-size: 13px; }

    /* Подвал */
    .gd-footer { padding: 16px; gap: 8px; }
    .gd-footer .mono { font-size: 11px; }

    /* Модальные окна */
    .gd-modal-overlay { padding: 14px; }
    .gd-modal { padding: 48px 18px 22px; border-radius: 14px; }
    .gd-modal h1 { font-size: 18px; }
    .gd-tabs { margin-bottom: 20px; }
    .gd-tab { font-size: 12px; padding: 9px 6px; }
    .gd-modal-actions { flex-direction: column-reverse; gap: 8px; }
    .gd-modal-actions .gd-btn { width: 100%; }

    /* Личный кабинет */
    .gd-dashboard { padding: 18px 14px; }
    .gd-dashboard-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .gd-dashboard-actions { width: 100%; flex-wrap: wrap; }
    .gd-dashboard-actions .gd-count-info { flex: 1 0 100%; order: -1; }
    .gd-dashboard-actions .gd-btn { flex: 1; }
    .gd-card-header { padding: 16px 18px; }
    .gd-card-body { padding: 16px; }
    .gd-form-row-2 { grid-template-columns: 1fr; }
    .gd-table { font-size: 12.5px; }
    .gd-table th { padding: 0 8px 10px; }
    .gd-table td { padding: 12px 8px; }
}

/* Более узкие телефоны — блок анимации уменьшаем ступенями, чтобы он
   плотно заполнял ширину экрана и при этом не обрезался краем. */
@media (max-width: 480px) {
    .gd-hero-visual { width: 322px; height: 294px; }
    .gd-hero-visual-stage { animation: gdFloatScale70 6s ease-in-out infinite; }
}

@media (max-width: 400px) {
    .gd-hero-visual { width: 290px; height: 265px; }
    .gd-hero-visual-stage { animation: gdFloatScale63 6s ease-in-out infinite; }
}

@media (max-width: 360px) {
    .gd-hero-visual { width: 258px; height: 235px; }
    .gd-hero-visual-stage { animation: gdFloatScale56 6s ease-in-out infinite; }
}

/* =========================================================
   СТРАНИЦЫ ОШИБОК (404, 403, 419, 429, 500, 503 и т.д.)
   ========================================================= */

.gd-error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    gap: 20px;
}
.gd-error-logo { display: inline-flex; }
.gd-error-logo img { height: 26px; }
.gd-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gd-accent-soft);
    color: var(--gd-accent);
    font-size: 24px;
    margin-bottom: 4px;
}
.gd-error-code {
    font-family: var(--gd-mono);
    font-size: 88px;
    font-weight: 700;
    line-height: 1;
    color: var(--gd-accent);
    letter-spacing: -.02em;
}
.gd-error-title { font-size: 25px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.gd-error-message { color: var(--gd-text-muted); max-width: 460px; margin: 0; font-size: 15px; line-height: 1.65; }
.gd-error-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.gd-error-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--gd-mono);
    font-size: 11.5px;
    letter-spacing: .06em;
    color: var(--gd-text-faint);
    margin-top: 4px;
}
.gd-error-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gd-accent); animation: gdPulse 2s ease-in-out infinite; }

@media (max-width: 480px) {
    .gd-error-code { font-size: 64px; }
    .gd-error-title { font-size: 20px; }
}
