/* ============================================================
   Phony — DEMO mode overlay (locked-action modal).
   Sits OUTSIDE the regular page layout — uses position: fixed so
   flex/grid pages (dashboard, CRM) don't get squished.
   ============================================================ */

/* Floating "Демо-режим" pill — top center, doesn't break layout */
.demo-bar {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 12px;
    max-width: calc(100vw - 24px);
    background: rgba(20, 20, 28, 0.78);
    border: 1px solid rgba(124, 92, 255, 0.32);
    border-radius: 999px;
    color: #fff;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.5);
    animation: demo-bar-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
}
@keyframes demo-bar-in {
    from { opacity: 0; transform: translate(-50%, -16px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.demo-bar svg { width: 15px; height: 15px; flex: none; stroke: #c8b6ff; }
.demo-bar .demo-bar-text { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.demo-bar .demo-bar-text b { font-weight: 800; color: #fff; }
.demo-bar .demo-bar-text .demo-bar-sub { color: #c8c8d4; font-weight: 500; }
.demo-bar a, .demo-bar button.demo-bar-cta {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: linear-gradient(135deg, #4a9eff, #7c5cff);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
    white-space: nowrap;
}
.demo-bar a:hover, .demo-bar button.demo-bar-cta:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .demo-bar {
        top: 10px;
        padding: 6px 10px 6px 10px;
        font-size: 11.5px;
        gap: 8px;
        max-width: calc(100vw - 16px);
    }
    .demo-bar .demo-bar-sub { display: none; }
    .demo-bar svg { width: 13px; height: 13px; }
    .demo-bar a, .demo-bar button.demo-bar-cta { padding: 4px 10px; font-size: 11px; }
}

/* Don't fight the iOS notch */
@supports (padding: env(safe-area-inset-top)) {
    .demo-bar { top: calc(12px + env(safe-area-inset-top)); }
}

/* ===== Modal (iOS-feel sheet) ===== */
.demo-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}
.demo-modal.open {
    display: flex;
    animation: demo-fade 0.18s ease-out;
}
.demo-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 14, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.demo-modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: rgba(20, 20, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 22px;
    padding: 0 26px 24px;
    color: #e8e8ef;
    overflow: hidden;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
    animation: demo-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
}
@keyframes demo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demo-pop {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: none; }
}

.demo-modal-head {
    margin: 0 -26px;
    padding: 22px 26px 50px;
    background: linear-gradient(135deg, #4a9eff, #7c5cff);
    position: relative;
    overflow: hidden;
}
.demo-modal-head::before {
    content: '';
    position: absolute;
    top: -50px; right: -30px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}
.demo-modal-head::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -20px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.demo-modal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.4px;
}
.demo-modal-brand svg { width: 22px; height: 22px; }
.demo-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.demo-modal-close:hover { background: rgba(255, 255, 255, 0.32); }

.demo-modal-icon {
    position: relative;
    z-index: 2;
    width: 76px;
    height: 76px;
    margin: -38px auto 16px;
    background: #14141c;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px -8px rgba(124, 92, 255, 0.5);
}
.demo-modal-icon svg {
    width: 36px;
    height: 36px;
    stroke: #7c5cff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.demo-modal-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin: 0 0 6px;
    color: #fff;
}
.demo-modal-text {
    text-align: center;
    color: #c8c8d4;
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 20px;
}
.demo-modal-perks {
    list-style: none;
    margin: 0 0 22px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}
.demo-modal-perks li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    font-size: 13px;
    color: #cfcfdb;
}
.demo-modal-perks li svg {
    width: 16px;
    height: 16px;
    flex: none;
    stroke: #2ecc71;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.demo-modal-actions {
    display: flex;
    gap: 10px;
}
.demo-modal-btn {
    flex: 1;
    padding: 13px 18px;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.demo-modal-btn-primary {
    background: linear-gradient(135deg, #4a9eff, #7c5cff);
    color: #fff;
    box-shadow: 0 8px 24px -8px rgba(74, 158, 255, 0.55);
}
.demo-modal-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}
.demo-modal-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #c8c8d4;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.demo-modal-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

@media (max-width: 480px) {
    .demo-modal { padding: 0; align-items: flex-end; }
    .demo-modal-card {
        max-width: 100%;
        border-radius: 22px 22px 0 0;
        padding-bottom: calc(22px + env(safe-area-inset-bottom));
        animation: demo-slideup 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .demo-modal-title { font-size: 20px; }
}
@keyframes demo-slideup {
    from { transform: translateY(100%); }
    to { transform: none; }
}
