/**
 * AIEO Waitlist — front-end form for "Notify me when back in stock".
 * Visual mirror of om-ppe-wait-list so the shopper experience stays
 * identical when the admin flips AIEO's frontend toggle on.
 *
 * No colour of its own (11.3.10, the owner): a colour the shop did not pick is the theme's (its tokens), or a mix of
 * the text colour, or the browser's own Canvas and CanvasText where a theme has none.
 */
.aieo-waitlist-container {
    position: relative;
    margin: 20px 0;
    padding: 20px;
    background-color: var(--aieo-wl-bg, var(--wp--preset--color--subtle, color-mix(in srgb, currentColor 6%, transparent)));
    border: var(--aieo-wl-border-w, 1px) solid var(--aieo-wl-border, var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent)));
    border-radius: var(--aieo-wl-border-r, 8px);
    color: var(--aieo-wl-ink, currentColor);
    opacity: 1 !important;
}

.aieo-waitlist-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    background-color: color-mix(in srgb, var(--aieo-wl-bg, var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas))) 80%, transparent);
    border-radius: 8px;
    z-index: 10;
}
.aieo-waitlist-overlay.is-loading { display: flex !important; }

.aieo-waitlist-loader svg {
    width: 40px;
    height: 40px;
    color: var(--wp--preset--color--accent, currentColor);
    animation: aieo-waitlist-spin 1s linear infinite;
}
@keyframes aieo-waitlist-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.aieo-waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 1 !important;
}

.aieo-waitlist-title {
    margin: 0 0 5px 0 !important;
    font-size: var(--aieo-wl-title-size, 16px) !important;
    font-weight: 600 !important;
    color: inherit !important;
    line-height: 1.4 !important;
    opacity: 1 !important;
}

.aieo-waitlist-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.aieo-waitlist-field label {
    opacity: 1 !important;
}
/* Brief section 23: under the theme's design authority the field, its label and
 * the focus ring are the theme's; these are its own look under ours. */
html:not([data-rooster-design="theme"]) .aieo-waitlist-field label {
    font-size: var(--aieo-wl-text-size, 14px) !important;
    font-weight: 500 !important;
    color: color-mix(in srgb, currentColor 80%, transparent) !important;
}
.aieo-waitlist-field label .required { color: var(--wp--preset--color--danger, currentColor); font-weight: 700; }

.aieo-waitlist-field input[type="email"] {
    width: 100%;
    box-sizing: border-box;
}
html:not([data-rooster-design="theme"]) .aieo-waitlist-field input[type="email"] {
    padding: 12px 15px;
    font-size: var(--aieo-wl-text-size, 14px);
    border: 1px solid var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent));
    border-radius: var(--aieo-shape-control, 4px);
    background-color: var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas));
    color: var(--wp--preset--color--fg, var(--wp--preset--color--contrast, CanvasText));
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
html:not([data-rooster-design="theme"]) .aieo-waitlist-field input[type="email"]:focus {
    border-color: var(--wp--preset--color--accent, currentColor);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--wp--preset--color--accent, currentColor) 20%, transparent);
}
html:not([data-rooster-design="theme"]) .aieo-waitlist-field input[type="email"]::placeholder { color: color-mix(in srgb, currentColor 55%, transparent); }

.aieo-waitlist-submit {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px !important;
    font-size: var(--aieo-wl-text-size, 14px) !important;
    font-weight: 600 !important;
    color: var(--aieo-wl-btn-text, var(--wp--custom--rooster--button--text, var(--wp--preset--color--on-accent, var(--wp--preset--color--base, Canvas)))) !important;
    background-color: var(--aieo-wl-btn-bg, var(--wp--custom--rooster--button--background, var(--wp--preset--color--accent, CanvasText))) !important;
    border: var(--aieo-wl-btn-border-w, 0) solid var(--aieo-wl-btn-border, var(--wp--custom--rooster--button--background, var(--wp--preset--color--accent, currentColor))) !important;
    border-radius: var(--aieo-wl-btn-border-r, 4px) !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease, transform 0.2s ease, filter 0.2s ease;
    align-self: flex-start;
    opacity: 1 !important;
}
.aieo-waitlist-submit:hover  { filter: brightness(0.92); transform: translateY(-1px); }
.aieo-waitlist-submit:active { transform: translateY(0); }
.aieo-waitlist-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.aieo-waitlist-message {
    display: none;
    margin-top: 10px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}
.aieo-waitlist-message.success {
    background-color: color-mix(in srgb, var(--wp--preset--color--success, currentColor) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--wp--preset--color--success, currentColor) 40%, transparent);
}
.aieo-waitlist-message.error {
    background-color: color-mix(in srgb, var(--wp--preset--color--danger, currentColor) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--wp--preset--color--danger, currentColor) 40%, transparent);
}

/* Variable products — show/hide based on the picked variation's stock state. */
.product-type-variable .aieo-waitlist-container { display: none; }
.product-type-variable .aieo-waitlist-container.show { display: block; }

@media (max-width: 768px) {
    .aieo-waitlist-container { padding: 15px; }
    .aieo-waitlist-submit { width: 100%; justify-content: center; }
}

/* Under the theme's design authority the box is the theme's quiet surface, in both schemes: its
 * subtle fill and border, the text in fg, the asterisk in danger, the notes as washes of success
 * and danger (theme brief, 28 Oct 2026: the fixed light box made its label unreadable in dark). */
html[data-rooster-design="theme"] .aieo-waitlist-container {
    background-color: var(--wp--preset--color--subtle, color-mix(in srgb, currentColor 6%, transparent));
    border-color: var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent));
    color: var(--wp--preset--color--fg, currentColor);
}
html[data-rooster-design="theme"] .aieo-waitlist-title {
    color: var(--wp--preset--color--fg, currentColor) !important;
}
html[data-rooster-design="theme"] .aieo-waitlist-field label .required {
    color: var(--wp--preset--color--danger, currentColor);
}
html[data-rooster-design="theme"] .aieo-waitlist-overlay {
    background-color: color-mix(in srgb, var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas)) 80%, transparent);
}
html[data-rooster-design="theme"] .aieo-waitlist-loader svg {
    color: var(--wp--preset--color--accent, currentColor);
}
html[data-rooster-design="theme"] .aieo-waitlist-message.success {
    background-color: color-mix(in srgb, var(--wp--preset--color--success, currentColor) 14%, var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas)));
    border-color: color-mix(in srgb, var(--wp--preset--color--success, currentColor) 40%, var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas)));
    color: var(--wp--preset--color--fg, currentColor);
}
html[data-rooster-design="theme"] .aieo-waitlist-message.error {
    background-color: color-mix(in srgb, var(--wp--preset--color--danger, currentColor) 14%, var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas)));
    border-color: color-mix(in srgb, var(--wp--preset--color--danger, currentColor) 40%, var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas)));
    color: var(--wp--preset--color--fg, currentColor);
}
