/**
 * Voltride Newsletter Page (Mailster newsletter homepage, /newsletter-signup/)
 * Loaded via NewsletterPageManager.php — only on that page.
 *
 * Rows: .nl-intro-row (sign-up intro), .outer-newsletter (shared newsletter
 * block, styled in style.css), .nl-card-row (unsubscribe / profile / confirmed).
 *
 * Not in @layer: Mailster's form stylesheet is unlayered, and unlayered rules
 * beat layered ones. Mailster also prints inline colours on its message boxes,
 * hence the few !important below.
 */

/* ========================================
   Sign-up intro
   ======================================== */

.nl-intro-row {
    margin-top: 0;
    margin-bottom: 24px;
}

.nl-intro {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
}

.nl-intro h1 {
    color: var(--new-green);
    font-size: 48px;
    line-height: 110%;
    font-weight: 900;
    margin-bottom: 16px;
    text-wrap: balance;
}

.nl-lead {
    font: var(--body-xl);
    color: var(--new-green);
    letter-spacing: var(--letter-spacing-body);
    margin-bottom: 0;
}

/* ========================================
   Card: unsubscribe / profile / confirmed
   ======================================== */

.vc_row.nl-card-row {
    max-width: 680px;
    margin: 0 auto 80px !important; /* Woodmart's content area already pads the top */
    padding: 48px 40px 40px;
    background: var(--new-green);
    border-radius: var(--radius-24);
    box-shadow: var(--shadow-main);
    text-align: center;
}

.nl-card-row .nl-card-text h1 {
    color: var(--power-lime);
    font-size: 40px;
    line-height: 114%;
    font-weight: 900;
    margin-bottom: 16px;
    text-wrap: balance;
}

.nl-card-row .nl-card-text p {
    font: var(--body-xl);
    color: var(--new-light-green);
    letter-spacing: var(--letter-spacing-body);
    font-weight: 300;
    margin-bottom: 0;
}

.nl-card-row .nl-card-text p + p {
    margin-top: 32px;
}

.nl-card-row .nl-card-form {
    max-width: 440px;
    margin: 32px auto 0;
}

/* ========================================
   Mailster form inside the card
   ======================================== */

/* Row gap only: Mailster's half-width fields (49% + 49%) rely on space-between.
   In profile/unsubscribe mode Mailster treats the form like a popup
   (max-height: 98vh; overflow-y: auto) — no scroll box inside the card. */
.nl-card-row .mailster-block-form .mailster-block-form-inner {
    row-gap: 16px;
    max-height: none;
    overflow: visible;
}

/* Profile: keep the email label visible above its field, like First/Last Name
   (Mailster's inline label otherwise hides as soon as the field has a value) */
.nl-card-row.nl-state-profile .mailster-block-form .mailster-wrapper-inline {
    flex-direction: column;
}

.nl-card-row.nl-state-profile .mailster-block-form .mailster-wrapper-inline label.mailster-label {
    display: flex !important;
    order: -1;
    position: static;
    padding: 0;
    margin-bottom: 8px;
    color: var(--new-light-green);
}

/* ========================================
   Lists — same lime circles as the newsletter block (style.css)
   ======================================== */

.nl-card-row .mailster-block-form .mailster-wrapper-_lists {
    margin-top: 8px;
}

.nl-card-row .mailster-block-form .mailster-wrapper-_lists fieldset {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.nl-card-row .mailster-block-form .mailster-wrapper-_lists legend {
    margin-bottom: 10px;
    padding: 0;
    color: var(--new-light-green);
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 600;
    text-align: left;
}

.nl-card-row .mailster-block-form .mailster-group-checkbox {
    position: relative;
    display: block;
}

/* Native box hidden but still focusable/clickable through its label */
.nl-card-row .mailster-block-form .mailster-group-checkbox input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    margin: 0;
    opacity: 0;
    appearance: none;
}

.nl-card-row .mailster-block-form .mailster-group-checkbox label.mailster-label {
    position: relative;
    display: block;
    min-height: 24px;
    margin: 0;
    padding: 4px 0 0 36px;
    color: var(--new-light-green);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 300;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
    user-select: none;
}

/* Biryani sits ~1.5px high: trim the line box to cap height so the circle
   (centred on the label box) lines up with the letters. */
@supports (text-box: trim-both cap alphabetic) {
    .nl-card-row .mailster-block-form .mailster-group-checkbox label.mailster-label {
        padding-top: 7px;
        padding-bottom: 7px;
        line-height: 1;
        text-box: trim-both cap alphabetic;
    }
}

.nl-card-row .mailster-block-form .mailster-group-checkbox label.mailster-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    box-sizing: border-box;
    border: 2px solid var(--power-lime);
    border-radius: 50%;
    background-color: transparent;
    transition: all 0.2s ease;
}

.nl-card-row .mailster-block-form .mailster-group-checkbox input[type="checkbox"]:checked + label.mailster-label::before {
    background-color: var(--power-lime);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="12" viewBox="0 0 14 12" fill="none"><path d="M1.58398 7.29183L3.85898 10.2168C3.93575 10.3165 4.03412 10.3976 4.14669 10.454C4.25927 10.5102 4.38313 10.5403 4.50898 10.5418C4.63281 10.5433 4.7554 10.517 4.86784 10.4652C4.98028 10.4133 5.07973 10.337 5.15898 10.2418L12.4173 1.4585" stroke="%230F3F36" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

.nl-card-row .mailster-block-form .mailster-group-checkbox input[type="checkbox"]:focus-visible + label.mailster-label::before {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.nl-card-row .mailster-block-form .mailster-wrapper {
    margin-bottom: 0 !important; /* Mailster's per-form inline margin; gap handles spacing */
}

/* Email (and profile) inputs — same look as the Gravity Forms fields */
.nl-card-row .mailster-block-form .mailster-wrapper input.input {
    height: 56px;
    padding: 8px 24px 6px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--white);
    color: var(--new-green);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 300;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nl-card-row .mailster-block-form .mailster-wrapper input.input:focus {
    border-color: var(--power-lime);
    box-shadow: 0 0 0 1px var(--power-lime);
    outline: none;
}

/* Inline (placeholder-style) label */
.nl-card-row .mailster-block-form .mailster-wrapper-inline label.mailster-label {
    padding-inline: 24px;
    justify-content: flex-start;
    color: var(--status-refunded-text);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 300;
}

/* Stacked labels (profile form) */
.nl-card-row .mailster-block-form .mailster-wrapper:not(.mailster-wrapper-inline) > label.mailster-label,
.nl-card-row .mailster-block-form .mailster-group .mailster-label {
    color: var(--new-light-green);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 300;
    margin-bottom: 8px;
}

/* Submit — identical to the newsletter block's "Sign me up" button
   (style.css `.outer-newsletter #gform_9 .gform_button` on top of the sitewide
   GF pill in gravity-cutom-styles.css): 16px/700 uppercase, 120% line-height,
   12/16/8 padding → ~39px tall. */
.nl-card-row .mailster-block-form .wp-block-mailster-field-submit {
    justify-content: center;
    margin-top: 8px !important;
}

.nl-card-row .mailster-block-form .mailster-wrapper input[type="submit"].submit-button,
.nl-card-row .nl-button {
    display: inline-block;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0; /* theme gives submit inputs a min-height; the GF <button> has none */
    padding: 12px 16px 8px;
    line-height: 120%;
    border: none;
    border-radius: 48px;
    background: var(--power-lime);
    color: var(--new-green);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nl-card-row .mailster-block-form .mailster-wrapper input[type="submit"].submit-button:hover,
.nl-card-row .mailster-block-form .mailster-wrapper input[type="submit"].submit-button:focus-visible,
.nl-card-row .nl-button:hover,
.nl-card-row .nl-button:focus-visible {
    background: var(--volt-pink-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 102, 0.3);
}

/* Success / error messages */
.nl-card-row .mailster-block-form .mailster-block-form-info > div {
    border-radius: 12px;
    padding: 14px 20px 12px !important;
    font-family: var(--font-primary);
    font-size: 16px;
    text-align: center;
}

.nl-card-row .mailster-block-form .mailster-block-form-info-success {
    background: var(--new-light-green) !important;
    color: var(--new-green) !important;
}

.nl-card-row .mailster-block-form .mailster-block-form-info-error {
    background: var(--sales-light-red) !important;
    color: var(--sales-red) !important;
}

/* ========================================
   Mobile
   ======================================== */

@media (max-width: 768px) {
    .nl-intro h1 {
        font-size: 32px;
    }

    .vc_row.nl-card-row {
        margin: -16px 0 48px !important; /* pull up into Woodmart's mobile top padding */
        padding: 32px 20px 28px;
        border-radius: var(--radius-16);
    }

    .nl-card-row .nl-card-text h1 {
        font-size: 28px;
    }
}
