:root {
    --bw-link-bg: #0f0f0f;
    --bw-link-text: #f2f2f2;
    --bw-link-muted: #bcbcbc;
    --bw-link-border: #2e2e2e;
    --bw-link-accent: #80fd03;
    --bw-newsletter-focus-border: #ff00b9;
    --bw-newsletter-button-bg: #ffffff;
    --bw-newsletter-button-text: #333333;
    --bw-newsletter-privacy-text: #000000;
    --bw-link-logo-width: 180px;
    --bw-link-logo-rotate-duration: 18s;
    --bw-link-bg-image: none;
    --bw-link-bg-gradient: none;
    --bw-link-admin-bar-offset: 0px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    background: var(--bw-link-bg);
    background-image: var(--bw-link-bg-gradient), var(--bw-link-bg-image);
    background-size: 220% 220%, cover;
    background-position: 0% 50%, center;
    background-repeat: no-repeat;
    color: var(--bw-link-text);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Neutralize global smart-header body top padding on standalone Link Page only. */
body.bw-link-page-logo-round,
body.bw-link-page-logo-rotate,
body.bw-link-page-gradient-animated,
body[style*="--bw-link-bg:"] {
    padding-top: 0 !important;
}

.bw-link-page-gradient-animated {
    animation: bw-link-page-fade-in 220ms ease-out both, bw-link-gradient-float 14s ease-in-out infinite alternate;
}

.wrapper {
    min-height: 100vh;
    min-height: 100svh;
    min-height: calc(100vh - var(--bw-link-admin-bar-offset));
    min-height: calc(100svh - var(--bw-link-admin-bar-offset));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    animation: bw-link-page-fade-in 220ms ease-out both;
}

body.admin-bar {
    --bw-link-admin-bar-offset: 32px;
}

@media (max-width: 782px) {
    body.admin-bar {
        --bw-link-admin-bar-offset: 46px;
    }
}

body.admin-bar #wpadminbar {
    position: fixed;
}

.container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
}

.logo {
    margin-bottom: 24px;
}

.logo img {
    display: block;
    width: min(100%, var(--bw-link-logo-width));
    max-width: 100%;
    max-height: none;
    height: auto;
    margin: 0 auto;
}

.bw-link-page-logo-round .logo img {
    border-radius: 50%;
}

.bw-link-page-logo-rotate .logo img {
    animation: bw-link-logo-spin var(--bw-link-logo-rotate-duration) linear infinite;
    transform-origin: center;
}

.title {
    margin: 0 0 14px;
    font-size: 24px;
    line-height: 1.12;
    letter-spacing: 0.01em;
    font-weight: 700;
    color: #000000;
}

.description {
    margin: 0 0 28px;
    color: #111111;
    font-size: 16px;
    line-height: 1.55;
}

.newsletter-block {
    margin: 0 0 22px;
}

.newsletter-form {
    display: grid;
    gap: 10px;
}

.newsletter-email-combo {
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 14px;
    border: 3px solid #111111;
    background: #ffffff;
    overflow: hidden;
    padding: 4px;
    gap: 6px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.newsletter-field input {
    width: 100%;
    border: 1px solid var(--bw-link-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--bw-link-text);
    border-radius: 999px;
    font-size: 16px;
    line-height: 1.2;
    padding: 12px 16px;
    outline: none;
}

.newsletter-field-email {
    flex: 1 1 auto;
    min-width: 0;
}

.newsletter-email-combo .newsletter-field-email input {
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 10px 14px;
    color: #444444;
}

.newsletter-form input,
.newsletter-form select,
.newsletter-form textarea {
    font-size: 16px;
}

.newsletter-field input::placeholder {
    color: #8f8f8f;
}

.newsletter-field input:focus-visible {
    border-color: var(--bw-link-accent);
}

.newsletter-email-combo .newsletter-field-email input:focus-visible {
    border-color: transparent;
}

.newsletter-form .newsletter-submit,
.newsletter-form button.newsletter-submit,
.newsletter-form button[type="submit"].newsletter-submit {
    border: 2px solid #111111;
    background: var(--bw-newsletter-button-bg);
    color: var(--bw-newsletter-button-text);
    border-radius: 11px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    padding: 11px 18px;
    min-width: 150px;
    flex: 0 0 auto;
    cursor: default;
    opacity: 1;
    transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
    box-shadow: none;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
}

.newsletter-form .newsletter-submit:hover,
.newsletter-form button.newsletter-submit:hover,
.newsletter-form button[type="submit"].newsletter-submit:hover {
    opacity: 0.86;
}

.newsletter-form .newsletter-submit:disabled,
.newsletter-form button.newsletter-submit:disabled,
.newsletter-form button[type="submit"].newsletter-submit:disabled {
    opacity: 0.72;
    cursor: default;
    transform: none;
}

.newsletter-form.is-ready .newsletter-submit,
.newsletter-form.is-ready button.newsletter-submit,
.newsletter-form.is-ready button[type="submit"].newsletter-submit {
    background: #ff00b9;
    border-color: #ff00b9;
    color: #ffffff;
    opacity: 1;
    cursor: pointer;
}

.newsletter-form.is-ready .newsletter-submit:hover,
.newsletter-form.is-ready button.newsletter-submit:hover,
.newsletter-form.is-ready button[type="submit"].newsletter-submit:hover {
    transform: translateY(-1px);
}

.newsletter-form.is-ready .newsletter-submit:active,
.newsletter-form.is-ready button.newsletter-submit:active,
.newsletter-form.is-ready button[type="submit"].newsletter-submit:active {
    transform: translateY(0);
}

.newsletter-email-combo.is-invalid {
    border-color: #f06767;
    box-shadow: 0 0 0 1px rgba(240, 103, 103, 0.28);
}

.newsletter-email-combo.has-input,
.newsletter-email-combo:focus-within {
    border-color: var(--bw-newsletter-focus-border);
    box-shadow: 0 0 0 1px var(--bw-newsletter-focus-border);
}

.newsletter-consent {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bw-newsletter-privacy-text);
    font-size: 9px;
    line-height: 1.3;
    text-align: left;
}

.newsletter-consent input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #111111;
    border-radius: 4px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.newsletter-consent input[type="checkbox"]:checked {
    background: #ff00b9;
    border-color: #ff00b9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2 4.1 7.2 8 3.2' fill='none' stroke='%23ffffff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px 10px;
}

.newsletter-consent input[type="checkbox"]:focus-visible {
    outline: 2px solid #ff00b9;
    outline-offset: 2px;
}

.newsletter-consent.has-error input[type="checkbox"] {
    border-color: #f06767;
    box-shadow: 0 0 0 1px rgba(240, 103, 103, 0.3);
}

.newsletter-consent.has-error {
    animation: bw-newsletter-consent-shake 180ms ease;
}

.newsletter-consent a {
    color: var(--bw-newsletter-privacy-text);
    text-decoration: none;
    border-bottom: 0;
}

.newsletter-message {
    display: none;
    width: 100%;
    margin-top: 4px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #eef4fb;
    color: #1f344c;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
    align-items: flex-start;
    gap: 8px;
}

.newsletter-message.is-visible {
    display: flex;
}

.newsletter-message-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    margin-top: 1px;
    background: rgba(0, 0, 0, 0.12);
    color: currentColor;
}

.newsletter-message-text {
    flex: 1 1 auto;
}

.newsletter-message.is-loading {
    border-color: #c6d8ef;
    background: #eef4fb;
    color: #1f344c;
}

.newsletter-message.is-loading .newsletter-message-icon {
    position: relative;
    border-radius: 999px;
    background: rgba(31, 52, 76, 0.1);
    color: transparent;
}

.newsletter-message.is-loading .newsletter-message-icon::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid #2d5f96;
    border-right-color: transparent;
    animation: bw-newsletter-spin 0.8s linear infinite;
}

.newsletter-message.is-success,
.newsletter-message.is-info {
    border-color: #b6dfc7;
    background: #eaf8ef;
    color: #1d5a35;
}

.newsletter-message.is-success .newsletter-message-icon,
.newsletter-message.is-info .newsletter-message-icon {
    background: #ccefd8;
}

.newsletter-message.is-error {
    border-color: #efb9b9;
    background: #fff0f0;
    color: #972929;
}

.newsletter-message.is-error .newsletter-message-icon {
    background: #f8dede;
}

@keyframes bw-newsletter-consent-shake {
    0% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(-2px);
    }
    60% {
        transform: translateX(2px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes bw-newsletter-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.newsletter-helper {
    margin: 10px 0 0;
    color: var(--bw-link-muted);
    font-size: 13px;
    line-height: 1.45;
}

.bw-newsletter-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.46);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 99999;
}

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

.bw-newsletter-modal-dialog {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    border: 0;
    background: #ffffff;
    color: #1d3528;
    padding: 18px;
    text-align: center;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.bw-newsletter-modal-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #111111;
    margin-bottom: 10px;
}

.bw-newsletter-modal-icon svg {
    width: 24px;
    height: 24px;
}

.bw-newsletter-modal-title {
    margin: 0 0 8px;
    color: #1f3f2d;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 700;
}

.bw-newsletter-modal-body {
    margin: 0 0 16px;
    color: #30543f;
    font-size: 15px;
    line-height: 1.45;
}

.bw-newsletter-modal-close {
    min-width: 116px;
    border-radius: 22px;
    border: 3px solid #111111;
    background: #ff00b9;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    padding: 10px 18px;
    cursor: pointer;
    box-shadow: 3px 4px 0 0 #000000;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.bw-newsletter-modal-close:hover,
.bw-newsletter-modal-close:focus-visible {
    opacity: 0.92;
}

.bw-newsletter-modal-close:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 2px 0 0 #000000;
}

.newsletter-image {
    margin-top: 12px;
    text-align: center;
}

.newsletter-image img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.links {
    display: grid;
    gap: 16px;
}

.link-item {
    width: 100%;
    min-height: 70px;
    padding: 12px 22px;
    border: 3px solid #111111;
    background: var(--bw-link-button-bg, transparent);
    border-radius: 22px;
    color: var(--bw-link-button-text, #111111);
    text-decoration: none;
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 5px 6px 0 0 #000000;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.link-item--email {
    flex-direction: column;
    gap: 6px;
}

.link-item-email-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.link-item-email-icon {
    font-size: 0.95em;
    line-height: 1;
}

.link-item-email-address {
    display: block;
    font-size: 0.52em;
    line-height: 1.2;
    opacity: 0.95;
    word-break: break-word;
}

.link-item::after {
    content: none;
}

@keyframes bw-link-logo-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bw-link-page-fade-in {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bw-link-gradient-float {
    0% {
        background-position: 0% 50%, center;
    }
    50% {
        background-position: 100% 50%, center;
    }
    100% {
        background-position: 0% 50%, center;
    }
}

.link-item:hover {
    transform: translateY(1px);
}

.link-item:focus-visible {
    outline: 2px solid var(--bw-link-accent);
    outline-offset: 2px;
}

.link-item:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 4px 0 0 #000000;
}

.link-item:active::after {
    content: none;
}

.socials {
    margin-top: 30px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.socials a {
    color: var(--bw-link-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.socials a:hover,
.socials a:focus-visible {
    color: var(--bw-link-accent);
    opacity: 1;
}

.socials a:active {
    opacity: 0.8;
}

@media (max-width: 480px) {
    .wrapper {
        align-items: center;
        min-height: 100svh;
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .title {
        font-size: 22px;
    }

    .newsletter-email-combo {
        gap: 6px;
        padding: 3px;
    }

    .newsletter-form .newsletter-submit,
    .newsletter-form button.newsletter-submit,
    .newsletter-form button[type="submit"].newsletter-submit {
        min-width: 0;
        padding: 12px 18px;
        font-size: 15px;
    }

    .newsletter-consent {
        font-size: 9px;
        gap: 8px;
    }

    .newsletter-consent input[type="checkbox"] {
        width: 14px;
        height: 14px;
        min-width: 14px;
    }

    .link-item {
        font-size: 20px;
        min-height: 62px;
        padding: 10px 16px;
        border-radius: 18px;
    }

    .link-item::after {
        content: none;
    }
}

@media (min-width: 640px) {
    .wrapper {
        justify-content: flex-start;
        align-items: center;
        padding-top: clamp(16px, 3.5svh, 48px);
        padding-bottom: clamp(20px, 4svh, 44px);
        padding-left: 16px;
        padding-right: 16px;
    }
}

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

    .bw-link-page-gradient-animated {
        animation: bw-link-page-fade-in 220ms ease-out both;
    }

    .bw-link-page-logo-rotate .logo img {
        animation: none;
    }
}
