/* ============================================================
   Newsletter strony głównej — bezpośrednio nad globalnym footerem
   ============================================================ */
.tofaa-home-newsletter {
    --tofaa-purple: #7C4FA0;
    --tofaa-purple-light: #B083BC;
    --tofaa-green: #d1d635;
    --tofaa-beige: #F8EAE1;
    --tofaa-black: #171717;
    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(42px, 4.6vw, 68px) 0;
    border-top: 0;
    border-bottom: 0;
    background: linear-gradient(135deg, #F8EAE1 0%, #F8EAE1 62%, rgba(176, 131, 188, .24) 100%);
    color: var(--tofaa-purple);
    font-family: "Rubik", Arial, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
}

.tofaa-home-newsletter *,
.tofaa-home-newsletter *::before,
.tofaa-home-newsletter *::after {
    box-sizing: border-box;
}

.tofaa-home-newsletter__inner {
    width: min(1380px, calc(100% - 72px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(480px, 1.05fr);
    gap: clamp(48px, 7vw, 112px);
    align-items: center;
}

.tofaa-home-newsletter__intro {
    min-width: 0;
}


.tofaa-home-newsletter h2 {
    max-width: 790px;
    margin: 0;
    color: var(--tofaa-purple);
    font-family: "Rubik", Arial, sans-serif;
    font-size: clamp(38px, 4.5vw, 68px);
    line-height: .94;
    font-weight: 950;
    letter-spacing: -.055em;
    text-transform: uppercase;
}

.tofaa-home-newsletter__lead {
    max-width: 620px;
    margin: 24px 0 0;
    color: var(--tofaa-purple);
    font-size: clamp(16px, 1.35vw, 20px);
    line-height: 1.42;
    font-weight: 550;
}

.tofaa-home-newsletter__form {
    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(24px, 3vw, 38px);
    border: 1px solid var(--tofaa-black);
    border-radius: 24px;
    background: var(--tofaa-purple-light);
    box-shadow: 0 10px 0 rgba(124, 79, 160, .24);
}

.tofaa-home-newsletter__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 13px;
    align-items: stretch;
}

.tofaa-home-newsletter__email {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    margin: 0;
    padding: 0 18px;
    border: 1px solid var(--tofaa-black) !important;
    border-radius: 15px !important;
    outline: none;
    background: #fff !important;
    color: var(--tofaa-purple) !important;
    -webkit-text-fill-color: var(--tofaa-purple) !important;
    font-family: "Rubik", Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 550 !important;
    box-shadow: none !important;
    transition: box-shadow .18s ease, transform .18s ease;
}

.tofaa-home-newsletter__email::placeholder {
    color: rgba(124, 79, 160, .58) !important;
    -webkit-text-fill-color: rgba(124, 79, 160, .58) !important;
    opacity: 1;
}

.tofaa-home-newsletter__email:focus {
    box-shadow: 0 0 0 2px rgba(209, 214, 53, .82) !important;
}

.tofaa-home-newsletter__submit {
    min-width: 174px;
    min-height: 58px;
    margin: 0 0 8px;
    padding: 0 25px;
    border: 1px solid var(--tofaa-black) !important;
    border-radius: 999px !important;
    background: var(--tofaa-green) !important;
    color: var(--tofaa-purple) !important;
    font-family: "Rubik", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    letter-spacing: .015em;
    text-transform: none;
    box-shadow: 0 8px 0 var(--tofaa-black) !important;
    cursor: pointer;
    transition:
        transform .18s cubic-bezier(.2, .8, .2, 1),
        box-shadow .18s cubic-bezier(.2, .8, .2, 1),
        opacity .18s ease !important;
}

.tofaa-home-newsletter__submit:hover,
.tofaa-home-newsletter__submit:focus-visible {
    transform: translateY(6px) !important;
    box-shadow: 0 2px 0 var(--tofaa-black) !important;
    outline: none;
}

.tofaa-home-newsletter__submit:active {
    transform: translateY(8px) !important;
    box-shadow: 0 0 0 var(--tofaa-black) !important;
}

.tofaa-home-newsletter__submit:disabled {
    cursor: wait;
    opacity: .72;
}

.tofaa-home-newsletter__consent {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 20px 2px 0;
    color: var(--tofaa-purple);
    font-size: 11px;
    line-height: 1.45;
    font-weight: 600;
    cursor: pointer;
}

.tofaa-home-newsletter__consent > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tofaa-home-newsletter__checkbox {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 1px solid var(--tofaa-black);
    border-radius: 4px;
    background: #fff;
}

.tofaa-home-newsletter__consent > input:checked + .tofaa-home-newsletter__checkbox {
    background: var(--tofaa-green);
}

.tofaa-home-newsletter__consent > input:checked + .tofaa-home-newsletter__checkbox::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--tofaa-purple);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tofaa-home-newsletter__consent > input:focus-visible + .tofaa-home-newsletter__checkbox {
    box-shadow: 0 0 0 2px var(--tofaa-green);
}

.tofaa-home-newsletter__consent-copy a {
    color: var(--tofaa-purple) !important;
    font-weight: 850 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 2px !important;
}

.tofaa-home-newsletter__status {
    min-height: 20px;
    margin: 13px 2px 0;
    color: var(--tofaa-purple);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
}

.tofaa-home-newsletter__status.is-error {
    color: #622b62;
}

.tofaa-home-newsletter__status.is-success {
    color: var(--tofaa-purple);
}

.tofaa-home-newsletter__honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.tofaa-home-newsletter.is-success .tofaa-home-newsletter__email,
.tofaa-home-newsletter.is-success .tofaa-home-newsletter__consent {
    opacity: .72;
}

@media (max-width: 980px) {
    .tofaa-home-newsletter__inner {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .tofaa-home-newsletter__intro {
        max-width: 780px;
    }
}

@media (max-width: 700px) {
    .tofaa-home-newsletter {
        padding: 40px 0 44px;
    }

    .tofaa-home-newsletter__inner {
        width: min(100% - 32px, 620px);
    }

    .tofaa-home-newsletter h2 {
        font-size: clamp(34px, 10vw, 52px);
    }

    .tofaa-home-newsletter__form {
        padding: 20px;
        border-radius: 18px;
    }

    .tofaa-home-newsletter__row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tofaa-home-newsletter__submit {
        width: 100%;
        margin-bottom: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tofaa-home-newsletter__email,
    .tofaa-home-newsletter__submit {
        transition: none !important;
    }
}

/* ============================================================
   Newsletter 318 — security / double opt-in
   ============================================================ */
.tofaa-home-newsletter .tofaa-security-trap {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.tofaa-home-newsletter .tofaa-turnstile-wrap {
    width: 100% !important;
    margin: 14px 2px 0 !important;
}
.tofaa-home-newsletter .cf-turnstile {
    max-width: 100% !important;
}

/* ============================================================
   Newsletter 321 — stany komunikatów + celebracja po wysłaniu i potwierdzeniu
   ============================================================ */
.tofaa-home-newsletter__status.is-error {
    color: #b4232f;
}

.tofaa-home-newsletter__status.is-success {
    color: #276b36;
}

.tofaa-home-newsletter__heart-burst {
    position: absolute;
    right: 2px;
    top: 50%;
    width: 1px;
    height: 1px;
    z-index: 5;
    pointer-events: none;
}

.tofaa-home-newsletter__heart-burst span {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    color: var(--tofaa-purple);
    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1;
    opacity: 0;
    transform: translate(-8px, -50%) scale(.35) rotate(0deg);
    transform-origin: center;
    will-change: transform, opacity;
}

.tofaa-home-newsletter.is-confirmed .tofaa-home-newsletter__heart-burst span,
.tofaa-home-newsletter.is-celebrating .tofaa-home-newsletter__heart-burst span {
    animation: tofaa-newsletter-heart-fly 1.25s cubic-bezier(.2, .8, .2, 1) var(--heart-delay) both;
}

.tofaa-home-newsletter.is-confirmed .tofaa-home-newsletter__heart-burst span:nth-child(2),
.tofaa-home-newsletter.is-confirmed .tofaa-home-newsletter__heart-burst span:nth-child(5),
.tofaa-home-newsletter.is-celebrating .tofaa-home-newsletter__heart-burst span:nth-child(2),
.tofaa-home-newsletter.is-celebrating .tofaa-home-newsletter__heart-burst span:nth-child(5) {
    font-size: 18px;
}

.tofaa-home-newsletter.is-confirmed .tofaa-home-newsletter__heart-burst span:nth-child(3),
.tofaa-home-newsletter.is-celebrating .tofaa-home-newsletter__heart-burst span:nth-child(3) {
    font-size: 30px;
}

@keyframes tofaa-newsletter-heart-fly {
    0% {
        opacity: 0;
        transform: translate(-14px, -50%) scale(.25) rotate(0deg);
    }
    14% {
        opacity: 1;
    }
    68% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--heart-x), calc(-50% + var(--heart-y))) scale(1.08) rotate(var(--heart-r));
    }
}

@media (prefers-reduced-motion: reduce) {
    .tofaa-home-newsletter.is-confirmed .tofaa-home-newsletter__heart-burst span,
    .tofaa-home-newsletter.is-celebrating .tofaa-home-newsletter__heart-burst span {
        animation: none;
    }
}
