/* ============================================================
   Стили формы подписки (модальное окно + кнопка)
   Путь: /subscribe/assets/subscribe.css
   ============================================================ */

/* -------- Кнопка «Подписаться» в статье -------- */
.subscribe-cta {
    max-width: 820px;
    margin: 40px auto 32px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #eff6ff 0%, #e8f0fa 100%);
    border-radius: 20px;
    border: 1px solid rgba(84, 141, 212, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.subscribe-cta-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 16px;
    color: #548DD4;
    box-shadow: 0 4px 12px rgba(84, 141, 212, 0.1);
}

.subscribe-cta-body {
    flex: 1;
    min-width: 220px;
}

.subscribe-cta-title {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.25;
}

.subscribe-cta-desc {
    font-size: 14px;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.subscribe-cta-btn {
    flex-shrink: 0;
    padding: 12px 26px;
    background: #548DD4;
    color: #ffffff;
    border: none;
    border-radius: 40px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.subscribe-cta-btn:hover {
    background: #3a6ea5;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(84, 141, 212, 0.5);
}

/* -------- Модальное окно -------- */
.sub-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sub-modal.open {
    display: flex;
}

.sub-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    animation: subFade 0.2s ease;
}

@keyframes subFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sub-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35);
    animation: subSlide 0.25s ease;
}

@keyframes subSlide {
    from { transform: translateY(20px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.sub-modal-head {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #eef2f4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sub-modal-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(84, 141, 212, 0.1);
    border-radius: 14px;
    color: #548DD4;
    font-size: 24px;
}

.sub-modal-title-block {
    flex: 1;
}

.sub-modal-title {
    font-size: 21px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.sub-modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.sub-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.sub-modal-close:hover {
    color: #548DD4;
}

.sub-modal-body {
    padding: 24px 32px 28px;
}

/* -------- Форма -------- */
.sub-field {
    margin-bottom: 18px;
}

.sub-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.sub-field label .req {
    color: #ed3940;
}

.sub-field input[type="text"],
.sub-field input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.2s;
    color: #0f172a;
}

.sub-field input:focus {
    outline: none;
    border-color: #548DD4;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(84, 141, 212, 0.1);
}

.sub-field input.error {
    border-color: #ed3940;
    background: #fef2f2;
}

.sub-field-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.sub-field-error {
    font-size: 12px;
    color: #ed3940;
    margin-top: 4px;
}

/* Радио-кнопки частоты */
.sub-frequency {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sub-frequency-option {
    position: relative;
    cursor: pointer;
}

.sub-frequency-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sub-frequency-label {
    display: block;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.15s;
    text-align: center;
    cursor: pointer;
}

.sub-frequency-label strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.sub-frequency-label span {
    display: block;
    font-size: 11px;
    color: #64748b;
    line-height: 1.35;
}

.sub-frequency-option input:checked + .sub-frequency-label {
    border-color: #548DD4;
    background: #eff6ff;
}

.sub-frequency-option input:checked + .sub-frequency-label strong {
    color: #548DD4;
}

.sub-frequency-option:hover .sub-frequency-label {
    border-color: #a8c4e6;
}

/* Чекбокс согласия */
.sub-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    margin: 16px 0;
    cursor: pointer;
}

.sub-checkbox input {
    margin-top: 3px;
    flex-shrink: 0;
}

.sub-checkbox span {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.sub-checkbox a {
    color: #548DD4;
    text-decoration: none;
}

.sub-checkbox a:hover {
    text-decoration: underline;
}

/* Honeypot */
.sub-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Кнопка отправки */
.sub-submit {
    width: 100%;
    padding: 14px;
    background: #548DD4;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}

.sub-submit:hover {
    background: #3a6ea5;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(84, 141, 212, 0.5);
}

.sub-submit:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* Сообщение об ошибке/успехе */
.sub-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.sub-status.visible {
    display: block;
}

.sub-status.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.sub-status.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Информация о частоте */
.sub-info {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
}

/* Успешный экран (когда всё отправлено) */
.sub-success {
    text-align: center;
    padding: 16px 0 8px;
}

.sub-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #548DD4, #3a6ea5);
    border-radius: 50%;
    color: #ffffff;
    font-size: 32px;
}

.sub-success h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px;
}

.sub-success p {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 20px;
}

.sub-success-close {
    padding: 10px 24px;
    background: #548DD4;
    color: #ffffff;
    border: none;
    border-radius: 40px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-success-close:hover {
    background: #3a6ea5;
}

/* Адаптив */
@media (max-width: 640px) {
    .subscribe-cta {
        flex-direction: column;
        text-align: center;
        padding: 22px;
        gap: 14px;
    }

    .subscribe-cta-btn {
        width: 100%;
    }

    .sub-modal-head {
        padding: 20px 22px 14px;
    }

    .sub-modal-body {
        padding: 18px 22px 24px;
    }

    .sub-modal-title {
        font-size: 18px;
    }

    .sub-frequency {
        grid-template-columns: 1fr;
    }
}

/* Убираем блокировку скролла body, когда модалка открыта */
body.sub-modal-open {
    overflow: hidden;
}