/* suite/static/css/main-style.css */

:root {
    --bg-page: #f4f5f7;
    --dot-color: #c0c4ce;
    --text-primary: #000000;
    --nav-bg: #e6e8ea;
    --card-black: #1c1c1e;
    --card-grey: #e2e1e1;
    --card-purple: #84cc16;
    --card-green: #db2777;
    --radius-large: 32px;
    --radius-small: 12px;
    --transition-theme: 0.3s ease;
    --shadow-normal: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover-black: 0 20px 40px rgba(0, 0, 0, 0.4);
    --shadow-hover-grey: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-hover-purple: 0 20px 40px rgba(132, 204, 22, 0.4);
    --shadow-hover-green: 0 20px 40px rgba(219, 39, 119, 0.4);
    --shadow-hover-card: 0 15px 40px rgba(0,0,0,0.15);
    --glow-pink: #ff0077;
    --glow-blue: #00d0ff;
    --glow-purple: #b47bf3;
    --glow-green: #ff4d4d;
}

body {
    --bg-page: #0a0a0a;
    --dot-color: #4a4a4d;
    --text-primary: #f4f5f7;
    --nav-bg: #2c2c2e;
    background-color: var(--bg-page);
}

body.light-mode {
    --bg-page: #f4f5f7;
    --dot-color: #c0c4ce;
    --text-primary: #000000;
    --nav-bg: #e6e8ea;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    transition: background-color var(--transition-theme);
    color: var(--text-primary);
}

/* ===== THEME SWITCH ===== */
.theme-switch-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    background: #1c1c1e;
    padding: 8px 14px;
    border-radius: 30px;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    border: 1px solid #3a3a42;
    -webkit-tap-highlight-color: transparent;
}
.theme-switch-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid #ff006a;
}
.theme-switch-wrapper span {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    transition: color var(--transition-theme);
}
.toggle-track {
    width: 36px;
    height: 20px;
    background: #3a3a3c;
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
}
.toggle-thumb {
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
body.light-mode .toggle-track { background: #555; }
body.light-mode .toggle-thumb { transform: translateX(0px); }
body:not(.light-mode) .toggle-thumb { transform: translateX(16px); }
body.light-mode .theme-switch-wrapper {
    background: #e6e8ea;
    border: 1px solid #c0c4ce;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
body.light-mode .theme-switch-wrapper:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #ff006a;
}
body.light-mode .theme-switch-wrapper span { color: #000; }

/* ===== DOTS ===== */
#dot-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}
.dot {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: var(--dot-color);
    border-radius: 50%;
    transition: background-color var(--transition-theme), transform 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    width: 100%;
    background-color: transparent;
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 40px 0;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}
.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-theme);
}
nav {
    display: flex;
    gap: 25px;
}
nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    transition: color var(--transition-theme), transform 0.2s;
}
nav a:hover { transform: translateY(-2px); }
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== LOGIN BUTTON ===== */
.btn-login {
    background: #1c1c1e;
    color: #fff;
    border: 1px solid #3a3a42;
    outline: none !important;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: 30px;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    box-shadow: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.btn-login:focus,
.btn-login:active,
.btn-login:focus-visible {
    outline: none !important;
    border: 1px solid #3a3a42 !important;
}
.btn-login:hover {
    transform: scale(1.05);
    background: #1c1c1e;
    border: 1px solid #ff006a;
    box-shadow: none;
}
body.light-mode .btn-login {
    background: #e6e8ea;
    color: #000;
    border: 1px solid #c0c4ce;
    box-shadow: none;
}
body.light-mode .btn-login:hover {
    background: #e6e8ea;
    border: 1px solid #ff006a;
    box-shadow: none;
}

/* ===== GRID ===== */
.grid-container {
    display: flex;
    gap: 24px;
    height: auto;
}
.left-col {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}
.right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== CARDS ===== */
.card {
    border-radius: var(--radius-large);
    position: relative;
    overflow: hidden;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-normal);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2), 
                box-shadow 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    will-change: transform;
}
.card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: calc(var(--radius-large) + 4px);
    background: transparent;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.card-black::before { content: none !important; }
.card-grey::before {
    background: linear-gradient(0deg, #4286f43d 0%, #ea443541 20%, #fbbd0531 40%, #34a85346 60%, #4286f43f 80%, #ea44353a 100%);
    background-size: 100% 600%;
}
.card-purple::before, .card-green::before { content: none !important; }

.card-black:hover::before, .card-grey:hover::before {
    opacity: 1;
    animation: shimmerGradient 6s ease-in-out infinite, breatheGlow 3.5s ease-in-out infinite;
}
@keyframes glowPulse {
    0% { opacity: 0.3; filter: blur(4px); }
    100% { opacity: 1; filter: blur(6px); }
}

.card-black {
    flex: 1;
    min-height: 480px;
    background-color: var(--card-black);
    color: #fff;
    position: relative;
    transition: background-color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2), 
                transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2),
                color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    will-change: transform, background-color, color;
}
.card-black:hover {
    transform: scale(1.02);
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.card-black h1 span {
    display: block;
    font-weight: 700;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    color: #ffffff;
}
.card-black:hover h1 span { color: #000000; }
.card-black .top-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 10px;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    color: #ffffff;
}
.card-black:hover .top-label { color: #000000; }

.image-placeholder-black {
    position: absolute;
    right: -20px;
    bottom: 40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 30% 30%, #444, #111);
    border-radius: 40px;
    transform: rotate(-10deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-black:hover .image-placeholder-black {
    transform: rotate(-5deg) scale(1.05);
}
.image-placeholder-black::after {
    content: '⚡';
    font-size: 80px;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.8));
}

.card-grey {
    flex: 0 0 280px;
    background-color: var(--card-grey);
    color: #000;
    position: relative;          /* Добавили, чтобы список позиционировался относительно этой карточки */
    overflow: visible !important; /* ГЛАВНОЕ: убрали обрезку контента, чтобы список выпадал */
}
.card-grey:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover-grey);
}
.card-grey .top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.card-grey .top-row span {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}
.card-grey h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 15px;
}

/* ===== SEARCH ===== */
.search-block-wrapper {
    background: #18181b;
    border-radius: 30px;
    padding: 6px 6px 6px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
    border: 1px solid #2e2e36;
    transition: all 0.3s;
    position: relative;
}
.search-block-wrapper::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 32px;
    background: linear-gradient(45deg, var(--glow-pink), var(--glow-blue));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}
.search-block-wrapper:hover::before {
    opacity: 1;
    animation: glowPulse 1.5s infinite alternate;
}
.search-block-wrapper:hover { border-color: transparent; }
.search-block-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    flex: 1;
    padding-right: 10px;
    color: #fff;
    width: 100%;
}
.search-block-wrapper input::placeholder {
    color: #6b6b76;
    opacity: 0;
}
.search-block-wrapper .search-icon {
    color: #fff;
    font-size: 18px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    line-height: 1;
}
.search-block-wrapper .search-btn {
    background: #2a2a31;
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
    line-height: 1;
}
.search-block-wrapper .search-btn:hover {
    background: #3a3a42;
    transform: scale(1.1);
}
.search-hint {
    position: absolute;
    bottom: 55px;
    left: 0;
    background: #18181b;
    color: #b9bdc7;
    border: 1px solid #2e2e36;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 13px;
    width: 100%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    z-index: 10;
}
.search-hint.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.typing-placeholder {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b6b76;
    font-size: 14px;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid #6b6b76;
    animation: blink-caret 0.75s step-end infinite;
    font-weight: 400;
    transition: opacity 0.3s;
}
.typing-placeholder.hidden { opacity: 0; }
@keyframes blink-caret {
    50% { border-color: transparent; }
}

/* ===== RIGHT BOTTOM ROW ===== */
.right-bottom-row {
    display: flex;
    gap: 24px;
    flex: 1;
}

.card-purple {
    flex: 1;
    background-color: #333333;
    color: #fff;
    border-radius: var(--radius-large);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: background-color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2), 
                transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2),
                color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    will-change: transform, background-color, color;

}

/* ===== ЗЕЛЁНЫЙ ПУЛЬСИРУЮЩИЙ КРУЖОК ===== */
.card-purple .pulse-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-green 2s infinite;
    flex-shrink: 0;
}
.card-purple:hover .pulse-dot {
    background-color: #16a34a; /* Чуть темнее при наведении */
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}
.card-purple:hover {
    transform: scale(1.02);
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.card-purple .top-row {
    display: flex;
    justify-content: space-between;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-purple:hover .top-row { color: #000000; }
.card-purple .small-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
    line-height: 1.2;
    max-width: 80px;
    color: #ffffff !important;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-purple:hover .small-label { color: #000000 !important; }
.card-purple .arrow-icon {
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-purple:hover .arrow-icon { color: #000000; }
.card-purple h3 {
    font-size: 32px;
    font-weight: 500;
    align-self: flex-end;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-purple:hover h3 { color: #000000; }

.card-green {
    flex: 1;
    background-color: #333333;
    border-radius: var(--radius-large);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2), 
                transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2),
                color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    will-change: transform, background-color, color;
}
.card-green:hover {
    transform: scale(1.02);
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.card-green .top-row {
    display: flex;
    justify-content: space-between;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-green:hover .top-row { color: #000000; }
.card-green .small-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
    line-height: 1.2;
    max-width: 100px;
    color: #ffffff !important;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-green:hover .small-label { color: #000000 !important; }
.card-green .arrow-icon {
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-green:hover .arrow-icon { color: #000000; }
.card-green h3 {
    font-size: 32px;
    font-weight: 500;
    align-self: flex-end;
    transition: color 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-green:hover h3 { color: #000000; }

/* ===== СВЕТЛАЯ ТЕМА ДЛЯ ЭТИХ ДВУХ БЛОКОВ ===== */
body.light-mode .card-purple {
    background-color: #333333; /* Твой цвет */
    color: #ffffff;            /* Белый текст */
}
body.light-mode .card-purple .small-label {
    color: #aaaaaa !important; /* Светло-серый ярлык */
}
body.light-mode .card-purple h3 {
    color: #ffffff;
}
body.light-mode .card-purple:hover {
    background-color: #444444;
}

body.light-mode .card-green {
    background-color: #333333; /* Теперь тоже #333333, как у левого! */
    color: #ffffff;
}
body.light-mode .card-green .small-label {
    color: #aaaaaa !important;
}
body.light-mode .card-green h3 {
    color: #ffffff;
}
body.light-mode .card-green:hover {
    background-color: #444444;
}

/* ===== BALANCE ROW ===== */
.balance-row {
    width: 100%;
    max-width: 100%;
    margin: 28px auto 0 auto;
    display: flex;
    gap: 24px;
}

.balance-card {
    background: rgba(28, 28, 30, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-large);
    padding: 28px 32px 24px 32px;
    position: relative;
    /* ВАЖНО: убираем overflow: hidden, чтобы свечение не обрезалось */
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2), 
                box-shadow 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    color: #fff;
}

.half-card { flex: 1; width: 50%; }

.balance-card:hover {
    transform: scale(1.01);
    background: rgba(28, 28, 30, 0.45);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

/* Свечение по краям (исправленный вариант через псевдо-элемент) */
.balance-glow {
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-large) + 2px);
    padding: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), #ff006a, rgba(255,255,255,0.4));
    background-size: 300% 100%;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.balance-card:hover .balance-glow {
    opacity: 1;
    animation: shimmerGradient 4s ease-in-out infinite, breatheGlow 2.5s ease-in-out infinite;
}

.balance-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.balance-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    color: #c8c8d0;
}

.balance-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    color: #fff;
}

.balance-desc {
    font-size: 14px;
    color: #aaa;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

/* ===== ПОЛЯ ВВОДА ===== */
.balance-input-wrap {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 30px;
    padding: 4px 4px 4px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border 0.3s;
}

.balance-input-wrap:focus-within { 
    border-color: #ff006a;
    background: rgba(255, 255, 255, 0.06);
}

.balance-icon {
    color: #6b6b76;
    font-size: 18px;
    margin-right: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.balance-input-wrap input {
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    flex: 1;
    padding: 10px 0;
    color: #fff;
    width: 100%;
}

.balance-input-wrap input::placeholder { color: #6b6b76; }

/* ===== КНОПКИ ===== */
.balance-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.balance-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.balance-btn-prime {
    background: #ff006a;
    color: #fff;
    border: none;
    padding: 6px 18px 6px 22px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    height: 36px;
    box-shadow: 0 0 20px rgba(255, 0, 106, 0.2);
}

.balance-btn-prime:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 0, 106, 0.4);
    background: #ff3385;
}

.balance-legal {
    font-size: 11px;
    color: #6b6b76;
    opacity: 0.8;
    line-height: 1.4;
    margin-top: 6px;
}

/* ===== СВЕТЛАЯ ТЕМА ===== */
body.light-mode .balance-card {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(0, 0, 0, 0.06);
    color: #000000;
}

body.light-mode .balance-card:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .balance-content h3 { color: #000000; }
body.light-mode .balance-desc { color: #444; }
body.light-mode .balance-label { color: #555; }

body.light-mode .balance-input-wrap {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .balance-input-wrap input { color: #000000; }
body.light-mode .balance-input-wrap input::placeholder { color: #999; }
body.light-mode .balance-input-wrap:focus-within { border-color: #ff006a; }
body.light-mode .balance-icon { color: #999; }

body.light-mode .balance-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}
body.light-mode .balance-btn:hover { background: rgba(0, 0, 0, 0.12); }

body.light-mode .balance-legal { color: #888; }
body.light-mode .balance-btn-prime {
    background: #ff006a;
    color: #fff;
}

/* ===== FEATURES ===== */
.features-section {
    margin-top: 60px;
    padding-bottom: 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card {
    background: #ffffff;
    border-radius: var(--radius-large);
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-normal);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
body.light-mode .feature-card { background: #ffffff; }
body:not(.light-mode) .feature-card {
    background: #1c1c1e;
    color: #fff;
}
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover-card);
}
.feature-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-large) + 4px);
    background: linear-gradient(90deg, rgba(255,255,255,0.8), #ff006a, rgba(255,255,255,0.8));
    background-size: 300% 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    padding: 2px;
}
.feature-card:hover::before {
    opacity: 1;
    animation: shimmerGradient 4s ease-in-out infinite, breatheGlow 2.5s ease-in-out infinite;
}
.feature-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}
.feature-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    flex: 1;
}
body:not(.light-mode) .feature-desc { color: #aaa; }
.feature-action {
    margin-top: 20px;
    position: relative;
    display: inline-block;
}
.popup-btn {
    background: transparent;
    border: 2px solid #1c1c1e;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    color: #000;
    transition: all 0.3s;
}
body:not(.light-mode) .popup-btn {
    border-color: #fff;
    color: #fff;
}
.popup-btn:hover {
    background: #1c1c1e;
    color: #fff;
}
body:not(.light-mode) .popup-btn:hover {
    background: #fff;
    color: #000;
}
.popup-box {
    visibility: hidden;
    opacity: 0;
    width: 220px;
    background-color: #fff;
    color: #000;
    text-align: center;
    border-radius: 12px;
    padding: 15px;
    position: absolute;
    z-index: 10;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    pointer-events: none;
}
body:not(.light-mode) .popup-box {
    background: #2c2c2e;
    color: #fff;
    box-shadow: 0 10px 30px rgba(255,255,255,0.1);
}
.popup-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}
body:not(.light-mode) .popup-box::after {
    border-color: #2c2c2e transparent transparent transparent;
}
.feature-action.active .popup-box {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0px);
}

@keyframes shimmerGradient {
    0% { background-position: 0% 0%; }   /* Градиент в самом низу */
    50% { background-position: 0% 100%; } /* Градиент поднимается наверх */
    100% { background-position: 0% 0%; }  /* Возвращается вниз */
}
@keyframes breatheGlow {
    0% { opacity: 0.3; filter: blur(4px); }
    50% { opacity: 0.9; filter: blur(8px); }
    100% { opacity: 0.3; filter: blur(4px); }
}

/* ===== FOOTER ===== */
footer {
    width: 100%;
    max-width: 1200px;
    margin-top: 40px;
    padding: 40px 0 20px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 30px;
}
body.light-mode footer { border-top-color: rgba(0,0,0,0.05); }
.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer-brand h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.footer-brand p {
    font-size: 14px;
    color: #aaa;
    line-height: 1.6;
}
body.light-mode .footer-brand p { color: #666; }
.footer-col h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.footer-col a {
    display: block;
    text-decoration: none;
    color: #aaa;
    font-size: 14px;
    margin-bottom: 8px;
    transition: color 0.2s;
}
body.light-mode .footer-col a { color: #666; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
    color: #888;
}
body.light-mode .footer-bottom {
    border-top-color: rgba(0,0,0,0.05);
    color: #666;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { 
    display: flex; 
}
.modal-content {
    background: #18181b;
    border-radius: 32px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
    color: #fff;
    border: 1px solid #2e2e36;
}
.modal-glow {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 34px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), #ff006a, rgba(255,255,255,0.8));
    background-size: 300% 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.modal-overlay.active .modal-glow {
    opacity: 1;
    animation: shimmerGradient 4s ease-in-out infinite, breatheGlow 2.5s ease-in-out infinite;
}
.modal-header {
    text-align: center;
    margin-bottom: 30px;
}
.modal-icon {
    width: 60px;
    height: 60px;
    background: #2a2a31;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 15px auto;
    box-shadow: 0 0 20px rgba(255,255,255,0.05);
}
.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}
.modal-header p {
    color: #888;
    font-size: 14px;
}
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block;
    font-size: 13px;
    color: #bbb;
    margin-bottom: 8px;
}
.input-group input {
    width: 100%;
    background: #2a2a31;
    border: 1px solid #3a3a42;
    border-radius: 14px;
    padding: 14px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}
.input-group input:focus { border-color: #888; }
.modal-submit {
    width: 100%;
    background: #f4f5f7;
    color: #000;
    border: none;
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}
.modal-submit:hover {
    background: #fff;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}
.modal-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}
.modal-footer-text a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
.modal-footer-text a:hover { color: #22c55e; }
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}
.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2a2a31;
    border: 1px solid #3a3a42;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.social-btn:hover {
    background: #3a3a42;
    transform: scale(1.1);
    border-color: #666;
}
.modal-overlay.active { cursor: pointer; }
.modal-content { cursor: default; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .grid-container, .right-bottom-row, .features-section, .footer-top {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
    .left-col, .right-col {
        flex: 1;
        min-height: auto;
    }
    .card-black { min-height: 400px; }
    .card-black h1 { font-size: 32px; }
    header {
        flex-direction: column;
        gap: 20px;
    }
    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    .image-placeholder-black {
        position: relative;
        right: 0;
        bottom: 0;
        align-self: center;
        margin-top: 20px;
        width: 150px;
        height: 150px;
    }
    .card-grey {
        flex: 1;
        min-height: 200px;
    }
    .theme-switch-wrapper {
        bottom: 20px;
        right: 20px;
    }
    .balance-row {
        flex-direction: column;
    }
    .half-card {
        width: 100%;
    }
}

/* ============================================================
   СТЕКЛЯННЫЕ КАРТОЧКИ И МОДАЛКА (GLASSMORPHISM)
   ============================================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 60px;
    padding-bottom: 40px;
    width: 100%;
    max-width: 1200px;
}

/* Полупрозрачные карточки (стекло) */
.feature-card-new {
    background: rgba(28, 28, 30, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 32px;
    padding: 28px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    display: flex;
    flex-direction: column;
    height: auto;
}

body.light-mode .feature-card-new {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(0, 0, 0, 0.06);
}

.feature-card-new:hover {
    transform: translateY(-6px);
    background: rgba(28, 28, 30, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

body.light-mode .feature-card-new:hover {
    background: rgba(255, 255, 255, 0.6);
}

.feature-title-new {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-desc-short {
    font-size: 14px;
    line-height: 1.5;
    color: #aaa;
    flex: 1;
    margin-bottom: 16px;
}

body.light-mode .feature-desc-short {
    color: #555;
}

.feature-toggle-btn {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.15);
    color: var(--text-primary);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
}

.feature-toggle-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.3);
}

body.light-mode .feature-toggle-btn {
    border-color: rgba(0,0,0,0.12);
}
body.light-mode .feature-toggle-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* ===== МОДАЛКА ДЛЯ КАРТОЧЕК (стекло + градиентная обводка) ===== */
.glass-modal {
    background: rgba(20, 20, 22, 0.75); /* Прозрачный тёмный фон */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 32px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    position: relative;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
    color: #ffffff;
    animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Убираем старую обводку */
    border: none;
    outline: none;
    /* Добавляем внутренний отступ, чтобы свечение не перекрывало контент */
    background-clip: padding-box; 
}

.glass-modal::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 34px;
    padding: 2px;
    /* Меняем градиент на динамичный с background-size 300% */
    background: linear-gradient(90deg, rgb(250, 249, 249), #ffffff, rgb(253, 253, 253));
    background-size: 300% 100%;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
    /* ДОБАВЛЯЕМ АНИМАЦИЮ */
    animation: shimmerGradient 4s ease-in-out infinite;
}

@keyframes modalPopIn {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

body.light-mode .glass-modal {
    background: rgba(230, 232, 234, 0.85); /* Светлое стекло */
    color: #000000;
}
body.light-mode .glass-modal::before {
    background: linear-gradient(135deg, rgba(0,0,0,0.1), #ff006a, rgba(0,0,0,0.1));
}

/* Кнопка закрытия */
.feature-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2;
}
.feature-modal-close:hover {
    color: #ffffff;
}
body.light-mode .feature-modal-close:hover {
    color: #000;
}

.feature-modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.feature-modal-body p {
    font-size: 15px;
    line-height: 1.7;
    color: #ddd;
    margin-bottom: 20px;
}

body.light-mode .feature-modal-body p {
    color: #333;
}

.feature-modal-image {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

body.light-mode .feature-modal-image {
    border-color: rgba(0,0,0,0.06);
}

/* ===== ОБЩИЕ СТИЛИ МОДАЛОК ДЛЯ КАРТОЧЕК ===== */
.modal-overlay.active {
    display: flex;
    cursor: pointer;
}
.modal-overlay.active .glass-modal {
    cursor: default;
}

/* ===== АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ ===== */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 10px;
    }
    .feature-card-new {
        padding: 20px;
    }
    .feature-title-new {
        font-size: 20px;
    }
    .glass-modal {
        padding: 24px;
        margin: 10px;
    }
    .feature-modal-image {
        max-height: 160px;
    }
}

/* ===== РЕЗУЛЬТАТЫ ПОИСКА ===== */

.search-container {
    position: relative;
    margin-top: 70px;  /* Отодвигает блок от заголовка */
}
.search-results {
    position: absolute;
    bottom: calc(100% + 8px); /* Появляется сразу под полем ввода */
    left: 0;
    right: 0;
    background: rgba(24, 24, 27, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 6px;
    display: none; /* Скрыто по умолчанию */
    flex-direction: column;
    gap: 2px;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
}

/* Показываем результаты, когда есть класс active */
.search-results.active {
    display: flex;
}

.search-result-item {
    padding: 10px 14px;
    border-radius: 10px;
    color: #f4f5f7;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Светлая тема */
body.light-mode .search-results {
    background: rgba(240, 242, 245, 0.95);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
body.light-mode .search-result-item {
    color: #000;
}
body.light-mode .search-result-item:hover {
    background: rgba(0, 0, 0, 0.06);
}