/**
 * Newsletter sektsioon + modal + toast
 */

/* ───────────────────────────────────────────────────────────────────
 * Sektsioon — vintage-cream paneel sügava teal-tausta peal
 * ─────────────────────────────────────────────────────────────────── */

.bubblos-newsletter {
    position: relative;
    background: var(--wp--preset--color--deep-charcoal);
    border-radius: var(--bubblos-radius-lg);
    padding: 3.5rem 2.5rem;
    margin: 3rem auto;
    overflow: hidden;
    box-shadow: var(--bubblos-shadow);
}

/* Mullide taust */
.bubblos-newsletter__bubbles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bubblos-newsletter__bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(245, 235, 210, 0.18),
        rgba(245, 235, 210, 0.04) 60%,
        transparent 100%
    );
    border: 1px solid rgba(245, 235, 210, 0.12);
    animation: bubblos-bubble-float 14s ease-in-out infinite;
}

.bubblos-newsletter__bubble--1 { width: 120px; height: 120px; top: 15%;  left: 8%;  animation-delay: 0s;   }
.bubblos-newsletter__bubble--2 { width:  80px; height:  80px; top: 65%;  left: 18%; animation-delay: 2s;   }
.bubblos-newsletter__bubble--3 { width: 200px; height: 200px; top: -8%;  left: 45%; animation-delay: 4s;   }
.bubblos-newsletter__bubble--4 { width:  60px; height:  60px; top: 75%;  left: 55%; animation-delay: 1s;   }
.bubblos-newsletter__bubble--5 { width: 140px; height: 140px; top: 40%;  right: 5%; animation-delay: 3s;   }
.bubblos-newsletter__bubble--6 { width:  90px; height:  90px; top: 8%;   right: 22%; animation-delay: 5s;  }
.bubblos-newsletter__bubble--7 { width:  50px; height:  50px; top: 80%;  right: 28%; animation-delay: 2.5s; }

@keyframes bubblos-bubble-float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-12px) translateX(6px) scale(1.04);
        opacity: 0.9;
    }
    50% {
        transform: translateY(-18px) translateX(-4px) scale(0.96);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-8px) translateX(8px) scale(1.02);
        opacity: 0.85;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bubblos-newsletter__bubble {
        animation: none;
    }
}

/* Sisu */
.bubblos-newsletter__inner {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .bubblos-newsletter {
        padding: 2.5rem 1.5rem;
    }

    .bubblos-newsletter__inner {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        text-align: center;
    }
}

/* Tekst */
.bubblos-newsletter__eyebrow {
    font-family: var(--wp--preset--font-family--posada);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--wp--preset--color--brass-gold);
    margin: 0 0 0.75rem;
}

.bubblos-newsletter__title {
    font-family: var(--wp--preset--font-family--posada);
    font-size: clamp(1.85rem, 4vw, 2.5rem);
    color: var(--wp--preset--color--vintage-cream);
    margin: 0 0 0.85rem;
    line-height: 1.15;
}

.bubblos-newsletter__title em {
    color: var(--wp--preset--color--carnival-orange);
    font-style: italic;
    font-weight: inherit;
}

.bubblos-newsletter__lead {
    color: rgba(245, 235, 210, 0.85);
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0;
    max-width: 38ch;
}

@media (max-width: 768px) {
    .bubblos-newsletter__lead {
        margin-left: auto;
        margin-right: auto;
    }
}

/* CTA */
.bubblos-newsletter__cta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}

.bubblos-newsletter__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.75rem;
    background: var(--wp--preset--color--carnival-orange);
    color: var(--wp--preset--color--white);
    border: 2px solid transparent;
    border-radius: var(--bubblos-radius-md);
    font-family: var(--wp--preset--font-family--posada);
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.bubblos-newsletter__btn:hover,
.bubblos-newsletter__btn:focus-visible {
    background: var(--wp--preset--color--carnival-orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(232, 136, 56, 0.4);
    outline: none;
}

.bubblos-newsletter__note {
    margin: 0;
    color: rgba(245, 235, 210, 0.6);
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
}

/* ───────────────────────────────────────────────────────────────────
 * Modal
 * ─────────────────────────────────────────────────────────────────── */

.bubblos-newsletter-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.bubblos-newsletter-modal[hidden] {
    display: none;
}

.bubblos-newsletter-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 52, 56, 0.75);
    backdrop-filter: blur(4px);
    animation: bubblos-newsletter-fade-in 0.25s ease;
}

.bubblos-newsletter-modal__box {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    background: var(--wp--preset--color--vintage-cream);
    border-radius: var(--bubblos-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    box-sizing: border-box; /* ← lisa see */
    animation: bubblos-newsletter-modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubblos-newsletter-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes bubblos-newsletter-modal-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bubblos-newsletter-modal__overlay,
    .bubblos-newsletter-modal__box {
        animation: none;
    }
}

.bubblos-newsletter-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--wp--preset--color--body-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.bubblos-newsletter-modal__close:hover,
.bubblos-newsletter-modal__close:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: var(--wp--preset--color--deep-charcoal);
    outline: none;
}

.bubblos-newsletter-modal__header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.bubblos-newsletter-modal__eyebrow {
    font-family: var(--wp--preset--font-family--posada);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--wp--preset--color--brass-gold);
    margin: 0 0 0.5rem;
}

.bubblos-newsletter-modal__title {
    font-family: var(--wp--preset--font-family--posada);
    font-size: 1.6rem;
    color: var(--wp--preset--color--deep-charcoal);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.bubblos-newsletter-modal__title em {
    color: var(--wp--preset--color--carnival-orange);
    font-style: italic;
}

.bubblos-newsletter-modal__lead {
    color: var(--wp--preset--color--body-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ───────────────────────────────────────────────────────────────────
 * Vorm
 * ─────────────────────────────────────────────────────────────────── */

.bubblos-newsletter-form__row {
    margin-bottom: 1rem;
}

.bubblos-newsletter-form__label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--wp--preset--color--deep-charcoal);
}

.bubblos-newsletter-form__input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid var(--bubblos-border);
    border-radius: var(--bubblos-radius-md);
    background: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--roboto);
    font-size: 1rem;
    color: var(--wp--preset--color--deep-charcoal);
    transition: border-color 0.15s ease;
    box-sizing: border-box; /* ← lisa see */
}

.bubblos-newsletter-form__input:focus {
    outline: none;
    border-color: var(--wp--preset--color--carnival-orange);
}

.bubblos-newsletter-form__honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.bubblos-newsletter-form__error {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: rgba(192, 57, 43, 0.08);
    border-left: 3px solid #c0392b;
    border-radius: var(--bubblos-radius-md);
    color: #c0392b;
    font-size: 0.9rem;
}

.bubblos-newsletter-form__submit {
    display: block;
    width: 100%;
    padding: 0.95rem 1.25rem;
    background: var(--wp--preset--color--carnival-orange);
    color: var(--wp--preset--color--white);
    border: 2px solid transparent;
    border-radius: var(--bubblos-radius-md);
    font-family: var(--wp--preset--font-family--posada);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    box-sizing: border-box;
}

.bubblos-newsletter-form__submit:hover:not(:disabled),
.bubblos-newsletter-form__submit:focus-visible:not(:disabled) {
    background: var(--wp--preset--color--carnival-orange-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(232, 136, 56, 0.3);
    outline: none;
}

.bubblos-newsletter-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bubblos-newsletter-form__note {
    text-align: center;
    margin: 1rem 0 0;
    color: var(--wp--preset--color--body-text-light);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ───────────────────────────────────────────────────────────────────
 * Toast — eduka liitumise teade
 * ─────────────────────────────────────────────────────────────────── */

.bubblos-newsletter-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--wp--preset--color--sage-green);
    color: var(--wp--preset--color--white);
    border-radius: var(--bubblos-radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 360px;
}

.bubblos-newsletter-toast[hidden] {
    display: none;
}

.bubblos-newsletter-toast.is-visible {
    transform: translateX(0);
}

.bubblos-newsletter-toast__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .bubblos-newsletter-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}