/*
 * Waitlist form section styles (Phase W3.1, Fluent Forms variant).
 * Mobile-first. Brand tokens only EXCEPT the primary-tint rgba literals
 * used for the badge background, focus ring, and GDPR consent row (still
 * carry TODO comments awaiting a brand-system token).
 *
 * NOTE: Selectors prefixed with .ff- or .frm-fluent-form are Fluent Forms
 * plugin internals and may change with plugin updates. If the form looks
 * broken after a plugin update, inspect element to find new class names.
 */

.waitlist {
    background-color: var(--color-bg);
    padding: 64px 24px;
    /* Anchor scroll lands clear of the nav. */
    scroll-margin-top: 80px;
}

.waitlist-inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

/* ---------- Section copy ---------- */

.waitlist-badge {
    display: inline-block;
    margin: 0 0 24px;
    padding: 6px 12px;
    /* TODO: brand-system token for primary-tint (rgba on --color-primary). */
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 999px;
}

.waitlist-headline {
    margin: 0 0 24px;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    line-height: 1.2;
    font-weight: 600;
    color: var(--color-text);
}

.waitlist-body {
    margin: 0 0 24px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    opacity: 0.85;
}

.waitlist-hook {
    margin: 0 0 32px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.waitlist-question {
    margin: 0 0 24px;
    font-size: 0.9375rem;
    color: var(--color-text);
    opacity: 0.8;
}

/* ---------- Fluent Forms scoped overrides ----------
 * Every rule below is scoped under .waitlist-form-wrap so the future
 * Contact form (also Fluent Forms) is not affected.
 */

/*
 * Force every descendant inside the form wrapper to left-align. The section
 * above is centered, and Fluent Forms wraps fields in deep .ff-el-group /
 * .ff-t-cell / .ff-el-input--label trees that inherit text-align: center
 * from .waitlist-inner. The universal selector here is intentional: the
 * specificity overrides plugin CSS and ensures consistent label alignment
 * across all fields.
 */
.waitlist-form-wrap,
.waitlist-form-wrap * {
    text-align: left;
}

/* Center exceptions: the Cloudflare Turnstile widget renders nicest centered. */
.waitlist-form-wrap .cf-turnstile {
    text-align: center;
}

/* Generic label / input fallbacks in case Fluent Forms changes class names. */
.waitlist-form-wrap label {
    display: block;
    text-align: left;
}

.waitlist-form-wrap input,
.waitlist-form-wrap select,
.waitlist-form-wrap textarea {
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.waitlist-form-wrap .frm-fluent-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Labels */
.waitlist-form-wrap .ff-el-input--label label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

/* Text inputs and selects */
.waitlist-form-wrap input[type="text"],
.waitlist-form-wrap input[type="email"],
.waitlist-form-wrap select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--color-input-border);
    border-radius: 8px;
    background-color: var(--color-white);
    color: var(--color-text);
}

.waitlist-form-wrap input[type="text"]:focus,
.waitlist-form-wrap input[type="email"]:focus,
.waitlist-form-wrap select:focus {
    outline: none;
    border-color: var(--color-primary);
    /* TODO: brand-system token for the focus-ring tint. */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Submit button */
.waitlist-form-wrap button[type="submit"],
.waitlist-form-wrap .ff-btn-submit {
    margin-top: 8px;
    padding: 14px 28px;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.waitlist-form-wrap button[type="submit"]:hover,
.waitlist-form-wrap .ff-btn-submit:hover {
    filter: brightness(1.1);
}

/* Success message (post-submit confirmation) */
.waitlist-form-wrap .ff-message-success {
    margin-top: 24px;
    padding: 24px;
    background-color: var(--color-success);
    color: var(--color-white);
    font-size: 0.9375rem;
    line-height: 1.5;
    border-radius: 8px;
}

/* Validation errors */
.waitlist-form-wrap .ff-el-is-error,
.waitlist-form-wrap .text-danger {
    color: var(--color-hot);
    font-size: 0.875rem;
}

/* GDPR consent row */
.waitlist-form-wrap .ff-el-form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    /* TODO: brand-system token for the soft primary-tint background. */
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
}

.waitlist-form-wrap .ff-el-form-check input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px;
}

.waitlist-form-wrap .ff-el-form-check label {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text);
    opacity: 0.9;
}

/* ---------- Desktop (>= 768px) ---------- */

@media (min-width: 768px) {
    .waitlist {
        padding: 96px 24px;
    }
}
