/* =====================================================
   Subscribe Popup — subscribe_popup.css
   Совместимо со стилями сайта (Inter, Alumni Sans, #F3BD45)
   ===================================================== */

/* ----- Overlay ----- */
#sp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(34, 35, 58, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
#sp-overlay.sp-active {
    opacity: 1;
    visibility: visible;
}

/* ----- Modal window ----- */
#sp-modal {
    background: #ffffff;
    border-radius: 25px;
    border: 1px solid rgb(34, 35, 58);
    box-shadow: 0 20px 60px rgba(34, 35, 58, 0.22);
    max-width: 510px;
    width: 100%;
    overflow: hidden;
    transform: translateY(28px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    max-height: 95vh;
    overflow-y: auto;
}
#sp-overlay.sp-active #sp-modal {
    transform: translateY(0) scale(1);
}

/* ----- Header ----- */
.sp-header {
    background: linear-gradient(147deg, #feaa39 0%, #f3bd45 74%);
    padding: 26px 30px 20px;
    text-align: center;
    position: relative;
}
.sp-header h3 {
    color: #ffffff !important;
    font-family: 'Alumni Sans', sans-serif;
    font-size: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
    line-height: 1.1;
}
.sp-header p {
    color: rgba(255, 255, 255, 0.92);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    margin: 0;
    line-height: 1.45;
}
.sp-header-icon {
    font-size: 46px;
    display: block;
    margin-bottom: 8px;
    animation: sp-gift-bounce 2.2s ease-in-out infinite;
}
@keyframes sp-gift-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    30%       { transform: translateY(-7px) rotate(-4deg); }
    60%       { transform: translateY(-4px) rotate(3deg); }
}

/* ----- Close button ----- */
.sp-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sp-close-btn:hover { background: rgba(255, 255, 255, 0.45); }

/* ----- Progress bar ----- */
.sp-progress-bar {
    display: flex;
    gap: 6px;
    padding: 14px 28px;
    background: #fafafa;
    border-bottom: 1px solid rgba(34, 35, 58, 0.09);
}
.sp-pb-step {
    flex: 1;
    height: 5px;
    border-radius: 5px;
    background: #e8e8e8;
    transition: background 0.45s ease;
}
.sp-pb-step.sp-done {
    background: linear-gradient(90deg, #feaa39, #f3bd45);
}

/* ----- Body ----- */
.sp-body {
    padding: 22px 28px 26px;
}
.sp-intro {
    color: #403e52;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    text-align: center;
    line-height: 1.65;
    margin-bottom: 18px;
}

/* ----- Social rows ----- */
.sp-socials { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.sp-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    background: #F5F5F5;
    border-radius: 16px;
    border: 2px solid transparent;
    transition: background 0.3s, border-color 0.3s;
}
/* Выполненная строка — золотая подсветка, ссылка остаётся видимой */
.sp-row.sp-done {
    background: #fff9ec;
    border-color: rgba(243, 189, 69, 0.45);
}

/* Social icon / image */
.sp-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sp-icon-tg  { background: #27A7E5; }
.sp-icon-vk  { background: #4C75A3; }
.sp-icon-max { background: #FF6B35; }
.sp-icon svg { display: block; }

.sp-info { flex: 1; min-width: 0; }
.sp-net-name {
    color: #2F2D2D;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    display: block;
}
.sp-net-desc {
    color: #8B8585;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
}

/* Action area */
.sp-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Кнопка «Подписаться» — ВСЕГДА видима, даже после перехода ── */
.sp-btn-sub {
    display: inline-block;
    padding: 7px 15px;
    border-radius: 50px;
    border: 1.5px solid #F3BD45;
    background: #fff;
    color: #feaa39;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    line-height: 1.4;
}
.sp-btn-sub:hover {
    background: linear-gradient(147deg, #feaa39 0%, #f3bd45 74%);
    color: #fff;
    border-color: transparent;
    text-decoration: none;
}
/* После перехода — ссылка продолжает отображаться, но чуть тусклее */
.sp-row.sp-done .sp-btn-sub {
    opacity: 0.65;
}
.sp-row.sp-done .sp-btn-sub:hover {
    opacity: 1;
}

/* ── Чекмарк появляется рядом со ссылкой после перехода ── */
.sp-check {
    display: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}
.sp-row.sp-done .sp-check { display: flex; }

/* ----- reCAPTCHA section ----- */
.sp-captcha-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    background: linear-gradient(135deg, #fff9ed 0%, #fef5d4 100%);
    border-radius: 16px;
    border: 1px solid rgba(243, 189, 69, 0.45);
    text-align: center;
    margin-bottom: 4px;
}
.sp-captcha-wrap.sp-show { display: flex; }

.sp-captcha-title {
    color: #2F2D2D;
    font-family: 'Alumni Sans', sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}
.sp-captcha-sub {
    color: #8B8585;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 300;
    margin: 0;
}

.sp-captcha-status {
    color: #22c55e;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 6px;
}
.sp-captcha-status.sp-show { display: flex; }

.sp-btn-get-prize {
    display: none;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(147deg, #feaa39 0%, #f3bd45 74%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    letter-spacing: 0.5px;
}
.sp-btn-get-prize.sp-show { display: inline-block; }
.sp-btn-get-prize:hover   { opacity: 0.88; transform: translateY(-1px); }
.sp-btn-get-prize:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Error */
.sp-error-msg {
    display: none;
    color: #ef4444;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    text-align: center;
    margin-top: 6px;
}

/* Loading spinner */
.sp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* ----- Prize section ----- */
.sp-prize-wrap {
    display: none;
    text-align: center;
    padding: 8px 0;
    animation: sp-fade-up 0.5s ease forwards;
}
.sp-prize-wrap.sp-show { display: block; }
@keyframes sp-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sp-prize-emoji { font-size: 52px; display: block; margin-bottom: 8px; }
.sp-prize-title {
    color: #2F2D2D;
    font-family: 'Alumni Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 8px;
}
.sp-prize-sub {
    color: #403e52;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
    margin: 0;
}

/* ----- Floating trigger button ----- */
#sp-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(147deg, #62718D 0%, #62718D 75%);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    box-shadow: 0 8px 28px rgba(98, 113, 141, 0.45);
    transition: transform 0.25s, box-shadow 0.25s;
    animation: sp-pulse 2.2s ease-in-out infinite;
}
#sp-trigger.sp-visible { display: flex; }
#sp-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 36px rgba(98, 113, 141, 0.6);
    animation: none;
}
@keyframes sp-pulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(98, 113, 141, 0.45); }
    50%       { box-shadow: 0 8px 44px rgba(98, 113, 141, 0.7); }
}

/* ----- Mobile ----- */
@media (max-width: 576px) {
    #sp-modal { border-radius: 20px; }
    .sp-header { padding: 22px 20px 16px; }
    .sp-header h3 { font-size: 25px; }
    .sp-body { padding: 18px 18px 22px; }
    .sp-icon { width: 33px; height: 33px; border-radius: 10px; }
    #sp-trigger { bottom: 18px; right: 18px; width: 50px; height: 50px; font-size: 22px; }
}