/* ============================================================
   BONNIEBYTE PC - EMBEDS / THIRD PARTY WIDGET STYLES
   MailerLite • ReCAPTCHA • Iubenda Policy + Cookie Consent UI
   ============================================================ */

/* ============================================================
   MAILERLITE FORM (BRAND MATCHED)
   ============================================================ */

.ml-form-embedContainer {
    max-width: 420px;
    margin: 0 auto;
    background: transparent !important;
    padding: 0;
}

.ml-form-embedWrapper {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Email input field (fallback for original MailerLite markup) */
.ml-form-embedBody .ml-form-fieldRow input {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    border-radius: 6px !important;
    border: 2px solid var(--bb-blue) !important;
    background: var(--bb-surface) !important;
    color: var(--bb-text) !important;
}

.ml-form-embedBody .ml-form-fieldRow input::placeholder {
    color: var(--bb-text-muted) !important;
}

/* reCAPTCHA wrapper — hidden until user types */
.ml-form-recaptcha {
    margin: 10px 0;
    transform: scale(0.9);
    transform-origin: 0 0;
    display: none;
}

/* Optional: hidden iframe helper (just to be explicit) */
.ml-hidden-iframe {
    display: none;
    width: 0;
    height: 0;
    border: 0;
}

/* ============================================================
   CUSTOM BONNIEBYTE FORM (Used with JS success UI)
   ============================================================ */

.bb-form-group input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border-radius: 6px;
    border: 2px solid var(--bb-blue);
    background: var(--bb-panel);
    color: var(--bb-text);
    box-sizing: border-box;
}

html[data-theme="light"] .bb-form-group input {
    background: #fff;
    color: #000;
}

/* Submit button - full width, matches input width */
.bb-submit-btn {
    width: 100% !important;
    display: block;
    padding: 14px 18px !important;
    box-sizing: border-box;
}

/* Loader animation */
.bb-btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid transparent;
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 4px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Success / Error Messages */
.bb-success-message,
.bb-error-message {
    margin-top: 15px;
    font-size: 0.95rem;
    text-align: center;
    display: none;
}

.bb-success-message {
    color: #7ddc7d;
}

.bb-error-message {
    color: #ff7b7b;
}

/* ============================================================
   IUBENDA EMBEDDED TERMS / PRIVACY POLICY BOXES
   ============================================================ */

.iubenda-embed {
    background: var(--bb-panel) !important;
    border-radius: 10px !important;
    padding: 24px !important;
    border: 1px solid var(--bb-border) !important;
    color: var(--bb-text) !important;
    box-shadow: var(--bb-shadow) !important;
    line-height: 1.6 !important;
    font-size: 15px !important;
}

.iubenda-embed a {
    color: var(--bb-blue) !important;
    text-decoration: none !important;
}

.iubenda-embed a:hover {
    color: #8ec4ff !important;
    text-decoration: underline !important;
}

/* Remove fallback banners */
.iubenda-embed-banner {
    display: none !important;
}

/* ============================================================
   IUBENDA COOKIE CONSENT UI (Brand-matched Dark Mode)
   ============================================================ */

.iubenda-consent-ui,
.iucs-consent-ui,
.iubenda-cs-container {
    background: rgba(13,13,13,0.95) !important;
    border-radius: 12px !important;
    border: 1px solid var(--bb-border) !important;
    backdrop-filter: blur(12px) !important;
    padding: 20px !important;
    box-shadow: var(--bb-shadow) !important;
    color: var(--bb-text) !important;
    font-family: Arial, sans-serif !important;
}

.iubenda-consent-content,
.iucs-consent-content {
    color: var(--bb-text) !important;
    line-height: 1.5 !important;
}

.iubenda-consent-btn,
.iucs-consent-btn,
.iubenda-cs-btn {
    background: var(--bb-blue) !important;
    border: 2px solid var(--bb-blue) !important;
    color: #fff !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: 0.25s ease !important;
}

.iubenda-consent-btn:hover,
.iucs-consent-btn:hover,
.iubenda-cs-btn:hover {
    background: #88bbff !important;
    border-color: #88bbff !important;
}

.iubenda-consent-btn.iubenda-consent-btn-secondary,
.iucs-consent-btn.iucs-consent-btn-secondary {
    background: transparent !important;
    color: var(--bb-text) !important;
    border: 2px solid var(--bb-text) !important;
}

.iubenda-consent-btn.iubenda-consent-btn-secondary:hover,
.iucs-consent-btn.iucs-consent-btn-secondary:hover {
    background: var(--bb-text) !important;
    color: #000 !important;
}

.iubenda-consent-close,
.iucs-consent-close {
    color: var(--bb-text-muted) !important;
    transition: 0.25s;
}

.iubenda-consent-close:hover,
.iucs-consent-close:hover {
    color: #fff !important;
}

.iubenda-cs-bottom,
.iubenda-cs-rationale {
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    max-width: 600px !important;
}

.iubenda-cs-container,
.iubenda-cs-rationale,
.iubenda-cs-bottom {
    background: rgba(0, 0, 0, 0.85) !important;
    border-radius: 10px !important;
}

/* PRINT — REMOVE IUBENDA ENTIRELY */
@media print {
    .iubenda-embed,
    .iubenda-cs-container,
    .iubenda-consent-ui,
    .iubenda-cs-bottom,
    .iubenda-cs-rationale,
    [class*="iubenda"] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* ============================================================
   RESPONSIVENESS
   ============================================================ */

@media (max-width: 768px) {
    .ml-form-embedContainer {
        padding: 0 10px;
    }

    .iubenda-consent-ui,
    .iucs-consent-ui {
        width: 95% !important;
        bottom: 10px !important;
    }

    .iubenda-consent-btn,
    .iucs-consent-btn {
        font-size: 14px !important;
        padding: 8px 14px !important;
    }
}
