/**
 * MA Newsletter Frontend Styles - Sleek & Compact Design
 */

/* Newsletter Wrapper */
.ma-newsletter-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.ma-newsletter-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 40px;
}

/* Header - Compact & Sleek */
.ma-newsletter-header {
    text-align: center;
    margin-bottom: 32px;
}

.ma-newsletter-heading {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 900;
    color: #000000;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ma-newsletter-description {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    color: #000000;
    font-weight: 600;
}

/* Form - Sleek Inline Design */
.ma-newsletter-form {
    position: relative;
}

.ma-newsletter-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: stretch;
}

.ma-newsletter-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    background: #ffffff;
    color: #000000;
    font-weight: 500;
}

.ma-newsletter-input:hover {
    border-color: #d1d5db;
    background: #ffffff;
}

.ma-newsletter-input:focus {
    border-color: #000000;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.ma-newsletter-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.ma-newsletter-submit {
    padding: 14px 32px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ma-newsletter-submit:hover {
    background-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.ma-newsletter-submit:active {
    transform: translateY(0);
}

.ma-newsletter-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ma-newsletter-submit .button-loader svg {
    display: block;
}

/* Turnstile - Compact */
.ma-newsletter-turnstile-wrapper {
    margin: 12px 0;
    display: flex;
    justify-content: center;
}

/* Messages - Sleek */
.ma-newsletter-message {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.ma-newsletter-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.ma-newsletter-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Privacy - Minimal */
.ma-newsletter-privacy {
    margin: 8px 0 0 0;
    font-size: 11px;
    color: #888;
    text-align: center;
    line-height: 1.3;
}

/* Disable scroll when modal is open */
html.ma-modal-open {
    overflow: hidden !important;
}

body.ma-modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Force footer elements below modal */
body.ma-modal-open #footer-outer,
body.ma-modal-open footer {
    z-index: 1 !important;
}

/* Verification Modal - Sleek Design */
.ma-newsletter-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    z-index: 999999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease, z-index 0s 0.3s;
}

.ma-newsletter-modal-overlay[style*="visibility: visible"] {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 9999999999 !important;
    transition: opacity 0.3s ease, visibility 0.3s ease, z-index 0s;
}

@keyframes ma-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal - Sleek & Modern */
.ma-newsletter-modal {
    background: #ffffff;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 99999999999 !important;
}

@keyframes ma-modal-slide-up {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal Header - Compact */
.ma-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.ma-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.ma-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ma-modal-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* Modal Body - Compact */
.ma-modal-body {
    padding: 24px;
}

.ma-verify-message {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    text-align: center;
}

.ma-verify-message strong {
    color: #1a1a1a;
    font-weight: 600;
}

#ma-verify-email-display {
    color: #000000;
}

/* Verification Code Input - Modern */
.ma-verify-code-input {
    width: 100%;
    padding: 14px;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 6px;
    text-align: center;
    border: 2px solid #000000;
    border-radius: 8px;
    background-color: #ffffff;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 16px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.ma-verify-code-input:focus {
    border-color: #000000;
    background-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.ma-verify-code-input::placeholder {
    color: #d1d5db;
    opacity: 1;
}

/* Verify Message Box */
.ma-verify-message-box {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.ma-verify-message-box.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.ma-verify-message-box.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Verify Button - Sleek */
.ma-verify-button {
    width: 100%;
    padding: 12px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ma-verify-button:hover {
    background-color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ma-verify-button:active {
    transform: translateY(0);
}

.ma-verify-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Verify Actions - Minimal */
.ma-verify-actions {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}

.ma-link-button {
    background: none;
    border: none;
    color: #000000;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    font-family: inherit;
    transition: color 0.2s ease;
    font-weight: 500;
}

.ma-link-button:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

.ma-link-button:disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}

.ma-separator {
    margin: 0 10px;
    color: #ccc;
}

/* Responsive - Mobile Optimized */
@media (max-width: 600px) {
    .ma-newsletter-wrapper {
        padding: 0;
    }

    .ma-newsletter-card {
        padding: 24px;
        border-radius: 20px;
    }

    .ma-newsletter-heading {
        font-size: 24px;
    }

    .ma-newsletter-description {
        font-size: 16px;
    }

    .ma-newsletter-input-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .ma-newsletter-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 18px;
    }

    .ma-newsletter-submit {
        width: 100%;
        padding: 14px 24px;
    }

    .ma-newsletter-modal {
        border-radius: 12px;
        max-width: calc(100% - 40px);
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .ma-modal-header {
        padding: 18px 20px;
        flex-shrink: 0;
    }

    .ma-modal-header h3 {
        font-size: 16px;
    }

    .ma-modal-body {
        padding: 20px;
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .ma-verify-code-input {
        font-size: 20px;
        letter-spacing: 4px;
        padding: 12px;
    }

    .ma-verify-button {
        font-size: 16px;
        padding: 14px;
        margin-top: auto;
    }

    .ma-verify-actions {
        flex-shrink: 0;
    }

    .cf-turnstile[data-size="normal"] {
        transform: scale(0.9);
        transform-origin: center;
    }
}

/* Extra compact variant for footer/sidebar */
.ma-newsletter-wrapper.compact .ma-newsletter-header {
    margin-bottom: 12px;
}

.ma-newsletter-wrapper.compact .ma-newsletter-heading {
    font-size: 16px;
}

.ma-newsletter-wrapper.compact .ma-newsletter-description {
    font-size: 12px;
}

.ma-newsletter-wrapper.compact .ma-newsletter-input,
.ma-newsletter-wrapper.compact .ma-newsletter-submit {
    padding: 8px 14px;
    font-size: 13px;
}
