/* ==========================================================================
   Newsletter signup (partials/newsletter-signup.hbs)
   Built from the Bifrost chrome tokens in bifrost.css: corner brackets,
   the green bracketed button, Geist / Geist Mono, square edges.
   ========================================================================== */

.mx-newsletter {
    --bf-corner-color: #9ca3af;
    position: relative;
    width: min(var(--content-width, 720px), calc(100% - 2 * var(--gap, 20px)));
    margin: 72px auto 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--bf-border, #e5e7eb);
    font-family: var(--bf-sans, "Geist", system-ui, sans-serif);
    text-align: left;
}

.mx-newsletter-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.6;
    pointer-events: none;
    /* fade the dots out toward the left so the text stays clean */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
}

.mx-newsletter-inner {
    position: relative;
    padding: 36px 40px 32px;
}

.mx-newsletter p {
    margin: 0;
}

.mx-newsletter-tag {
    font-family: var(--bf-mono, "Geist Mono", ui-monospace, monospace);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bf-primary-corner, #177b62);
}

.mx-newsletter .mx-newsletter-title {
    margin-top: 14px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #0a3d4a;
}

.mx-newsletter .mx-newsletter-text {
    margin-top: 8px;
    max-width: 480px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--bf-text-muted, #6b7280);
}

.mx-newsletter-form {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.mx-newsletter-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mx-newsletter-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--bf-text, #111827);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mx-newsletter-input::placeholder {
    color: #9ca3af;
}

.mx-newsletter-input:hover {
    border-color: #9ca3af;
}

.mx-newsletter-input:focus {
    border-color: var(--bf-primary, #33c09e);
    box-shadow: 0 0 0 3px rgba(51, 192, 158, 0.18);
}

.mx-newsletter-input[aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.mx-newsletter-btn {
    --bf-corner-color: var(--bf-primary-corner, #177b62);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    margin: 0;
    padding: 0 22px;
    font-family: var(--bf-mono, "Geist Mono", ui-monospace, monospace);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    background: var(--bf-primary, #33c09e);
    border: 2px solid var(--bf-primary-border, #82ceb6);
    border-radius: 0;
    box-shadow: 0 0 6px rgba(51, 192, 158, 0.55);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.mx-newsletter-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.mx-newsletter-btn:hover {
    background: var(--bf-primary-hover, #33a68b);
    box-shadow: 0 0 10px rgba(51, 192, 158, 0.6);
}

.mx-newsletter-btn:hover svg {
    transform: translateX(2px);
}

.mx-newsletter-btn:focus-visible {
    outline: 2px solid #0a3d4a;
    outline-offset: 3px;
}

.mx-newsletter-btn[disabled] {
    cursor: progress;
    opacity: 0.75;
}

.mx-newsletter-btn[disabled] svg {
    display: none;
}

/* Status line: errors under the form, confirmation in place of the form */

.mx-newsletter-status:empty {
    display: none;
}

.mx-newsletter .mx-newsletter-status {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #b91c1c;
}

.mx-newsletter.is-success .mx-newsletter-form {
    display: none;
}

.mx-newsletter.is-success .mx-newsletter-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 12px 14px;
    font-size: 15px;
    color: #0a3d4a;
    background: rgba(51, 192, 158, 0.08);
    border: 1px solid rgba(51, 192, 158, 0.35);
}

.mx-newsletter.is-success .mx-newsletter-status::before {
    content: "";
    flex: 0 0 18px;
    height: 18px;
    background: var(--bf-primary, #33c09e);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 600px) {
    .mx-newsletter {
        margin-top: 56px;
    }

    .mx-newsletter-inner {
        padding: 28px 20px 24px;
    }

    .mx-newsletter .mx-newsletter-title {
        font-size: 21px;
    }

    .mx-newsletter-form {
        flex-direction: column;
        gap: 10px;
    }

    .mx-newsletter-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mx-newsletter-input,
    .mx-newsletter-btn,
    .mx-newsletter-btn svg {
        transition: none;
    }
}
