/* AMTake subscribe modal — theme-aware (uses theme CSS vars with fallbacks). */
.amsub-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(6, 10, 20, .62);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    animation: amsub-fade .2s ease;
}
.amsub-overlay[hidden] { display: none; }
@keyframes amsub-fade { from { opacity: 0; } to { opacity: 1; } }

.amsub-modal {
    position: relative; width: 100%; max-width: 440px;
    background: var(--surface, #fff); color: var(--text, #0f172a);
    border: 1px solid var(--border, #e6eaf1);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    padding: 34px 30px 28px;
    text-align: center;
    animation: amsub-pop .28s cubic-bezier(.2, .9, .3, 1.3);
}
@keyframes amsub-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.amsub-close {
    position: absolute; top: 12px; right: 14px;
    width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: transparent; color: var(--muted, #64748b);
    font-size: 24px; line-height: 1; cursor: pointer; transition: background .2s ease;
}
.amsub-close:hover { background: color-mix(in srgb, var(--muted, #64748b) 14%, transparent); }

.amsub-badge {
    width: 60px; height: 60px; margin: 0 auto 16px;
    display: grid; place-items: center; border-radius: 16px;
    background: var(--grad, linear-gradient(135deg, #7c3aed, #2e6bf0)); color: #fff;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--c1, #7c3aed) 45%, transparent);
}
.amsub-title { font-size: 22px; margin: 0 0 8px; letter-spacing: -.4px; color: var(--text, #0f172a); }
.amsub-sub { color: var(--muted, #64748b); font-size: 14.5px; line-height: 1.6; margin: 0 auto 20px; max-width: 340px; }

.amsub-field { display: flex; gap: 8px; }
.amsub-input {
    flex: 1; min-width: 0; padding: 13px 15px; font-size: 15px;
    border: 1px solid var(--border, #e6eaf1); border-radius: 11px;
    background: var(--bg, #f7f9fc); color: var(--text, #0f172a);
}
.amsub-input:focus { outline: none; border-color: var(--c2, #2e6bf0); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c2, #2e6bf0) 20%, transparent); }
.amsub-submit {
    flex: none; padding: 13px 22px; font-size: 15px; font-weight: 600; cursor: pointer;
    border: 0; border-radius: 11px; color: #fff;
    background: var(--grad, linear-gradient(135deg, #7c3aed, #2e6bf0));
    transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.amsub-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px color-mix(in srgb, var(--c1, #7c3aed) 45%, transparent); }
.amsub-submit:disabled { opacity: .6; cursor: default; transform: none; }
.amsub-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.amsub-error { color: #dc2626; font-size: 13px; margin: 10px 0 0; text-align: left; }
.amsub-fine { color: var(--muted, #64748b); font-size: 12px; margin: 16px 0 0; }
.amsub-fine a { color: var(--c2, #2e6bf0); }

/* ---------- Thank-you view ---------- */
.amsub-check { position: relative; width: 84px; height: 84px; margin: 4px auto 14px; }
.amsub-check svg { width: 84px; height: 84px; }
.amsub-check-c { stroke: var(--c2, #2e6bf0); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: amsub-circle .5s ease forwards; }
.amsub-check-m { stroke: var(--c1, #7c3aed); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: amsub-mark .35s .45s ease forwards; }
@keyframes amsub-circle { to { stroke-dashoffset: 0; } }
@keyframes amsub-mark { to { stroke-dashoffset: 0; } }

.amsub-email-pill {
    display: inline-block; max-width: 100%;
    padding: 9px 18px; margin: 4px 0 6px;
    background: color-mix(in srgb, var(--c1, #7c3aed) 12%, var(--surface, #fff));
    border: 1px solid color-mix(in srgb, var(--c2, #2e6bf0) 35%, var(--border, #e6eaf1));
    border-radius: 999px;
    font-weight: 600; font-size: 15px; color: var(--text, #0f172a);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.amsub-thanks-note { color: var(--muted, #64748b); font-size: 14px; line-height: 1.6; margin: 12px auto 20px; max-width: 340px; }
.amsub-done {
    padding: 12px 26px; font-size: 15px; font-weight: 600; cursor: pointer;
    border: 0; border-radius: 11px; color: #fff;
    background: var(--grad, linear-gradient(135deg, #7c3aed, #2e6bf0));
    transition: transform .15s ease, box-shadow .2s ease;
}
.amsub-done:hover { transform: translateY(-1px); box-shadow: 0 6px 20px color-mix(in srgb, var(--c1, #7c3aed) 45%, transparent); }

/* Confetti dots */
.amsub-confetti, .amsub-confetti::before, .amsub-confetti::after {
    position: absolute; top: 8px; left: 50%; width: 7px; height: 7px; border-radius: 2px;
    opacity: 0;
}
.amsub-thanks-view:not([hidden]) .amsub-confetti { background: #f59e0b; animation: amsub-conf .8s .5s ease forwards; }
.amsub-thanks-view:not([hidden]) .amsub-confetti::before { content: ""; background: #ec4899; animation: amsub-conf2 .8s .55s ease forwards; }
.amsub-thanks-view:not([hidden]) .amsub-confetti::after { content: ""; background: #10b981; animation: amsub-conf3 .8s .6s ease forwards; }
@keyframes amsub-conf { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(-38px, -26px) rotate(180deg); } }
@keyframes amsub-conf2 { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(40px, -20px) rotate(200deg); } }
@keyframes amsub-conf3 { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(10px, -40px) rotate(-160deg); } }

/* ---------- Inline shortcode form ---------- */
.amsub-inline {
    max-width: 520px; margin: 20px 0; padding: 24px;
    background: var(--surface, #fff); border: 1px solid var(--border, #e6eaf1);
    border-radius: 16px; text-align: center;
}
.amsub-inline .amsub-title { font-size: 19px; }
.amsub-inline-thanks { color: #10b981; font-weight: 600; margin: 12px 0 0; }

@media (max-width: 460px) {
    .amsub-field { flex-direction: column; }
    .amsub-modal { padding: 30px 22px 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .amsub-overlay, .amsub-modal, .amsub-check-c, .amsub-check-m, .amsub-confetti { animation: none !important; }
    .amsub-check-c, .amsub-check-m { stroke-dashoffset: 0 !important; }
}
