/* === modals.css === */
/**
* Путь: /styles/modals.css
* Описание: Универсальные стили модальных окон с поддержкой светлой/темной темы
* Версия: 1.0
*/

/* === БАЗОВЫЕ СТИЛИ МОДАЛЬНЫХ ОКОН === */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal.active {
    display: flex;
    opacity: 1;
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === КОНТЕЙНЕР МОДАЛЬНОГО ОКНА === */
.modal-d {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 243, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-elevated);
    position: relative;
    animation: modalSlideIn 0.4s var(--ease-spring);
}

/* === КНОПКА ЗАКРЫТИЯ === */
.modal-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    z-index: 10;
}
.modal-x:hover {
    background: rgba(255, 0, 255, 0.08);
    border-color: rgba(255, 0, 255, 0.2);
    color: var(--neon-pink);
    transform: rotate(90deg);
}

/* === ЗАГОЛОВОК МОДАЛЬНОГО ОКНА === */
.modal-ttl {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === ФОРМЫ ВНУТРИ МОДАЛЬНЫХ ОКОН === */
.fg { margin-bottom: 16px; }
.fl {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 11px;
    color: var(--neon-cyan);
}
.fi, .fs, .ft {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid rgba(0, 243, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}
.ft { min-height: 90px; resize: vertical; }
.fi:focus, .fs:focus, .ft:focus {
    border-color: rgba(0, 243, 255, 0.25);
    box-shadow: var(--glow-cyan);
}
.fi::placeholder, .ft::placeholder { color: var(--text-muted); }

/* === ПРОМО-БОКС (VIP) === */
.pbox {
    margin: 14px 0;
    padding: 14px;
    background: rgba(255, 215, 0, 0.03);
    border: 1.5px solid rgba(255, 215, 0, 0.12);
    border-radius: var(--radius-md);
}
.pbox-l {
    color: var(--gold);
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pbox-h {
    color: var(--gold);
    font-size: 10px;
    margin-top: 5px;
    opacity: 0.8;
}

/* === АДАПТИВНОСТЬ МОДАЛЬНЫХ ОКОН === */
@media (max-width: 768px) {
    .modal { padding: 12px; }
    .modal-d { padding: 24px 20px; max-height: 90vh; }
    .modal-ttl { font-size: 18px; }
}
@media (max-width: 480px) {
    .modal-d { padding: 20px 16px; border-radius: var(--radius-lg); }
    .modal-ttl { font-size: 16px; margin-bottom: 16px; }
    .fi, .fs, .ft { padding: 9px 12px; font-size: 13px; }
}

/* === СВЕТЛАЯ ТЕМА === */
body.light-theme .modal { background: rgba(0, 0, 0, 0.5); }
body.light-theme .modal-d {
    background: linear-gradient(135deg, #ffffff 0%, #f3edff 50%, #eef6ff 100%);
    border-color: rgba(111, 76, 196, 0.14);
    box-shadow: 0 24px 70px rgba(55, 45, 105, 0.20);
}
body.light-theme .modal-x {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(17, 24, 39, 0.18);
    color: #111827;
}
body.light-theme .modal-x:hover {
    background: #fff;
    border-color: rgba(124, 58, 237, 0.34);
    color: #581c87;
}
body.light-theme .modal-ttl {
    background: linear-gradient(135deg, #8b5cf6, #0369a1, #8a4f00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.light-theme .fl { color: #08784e; }
body.light-theme .fi, body.light-theme .fs, body.light-theme .ft {
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.18);
    color: #111827;
}
body.light-theme .fi::placeholder, body.light-theme .ft::placeholder { color: rgba(17, 24, 39, 0.48); }
body.light-theme .fi:focus, body.light-theme .fs:focus, body.light-theme .ft:focus {
    border-color: rgba(0, 137, 94, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 137, 94, 0.15);
}
body.light-theme .pbox {
    background: rgba(255, 248, 214, 0.86);
    border-color: rgba(245, 158, 11, 0.28);
}
body.light-theme .pbox-l, body.light-theme .pbox-h { color: #3f2600; }

/* === КНОПКИ НА ВСЮ ШИРИНУ (В МОДАЛКАХ) === */
.modal .btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
    margin-top: 8px;
}