/**
 * Facta Newsletter Frontend Styles
 *
 * Cocoa Market Theme - Flat Green & Brown Colors (No Gradients)
 *
 * @package Facta_Newsletter
 */

/* Reset */
.facta-newsletter-container * {
    box-sizing: border-box;
}

/* Main Container */
.facta-newsletter-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 40px 20px;
    width: 100%;
    background: #f4f4f4;
}

.facta-newsletter-wrapper {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

/* Title and Subtitle */
.facta-newsletter-title {
    color: #2d2d2d;
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.facta-newsletter-subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 30px 0;
    font-size: 14px;
}

/* Steps */
.facta-step {
    margin-bottom: 30px;
}

.facta-step-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.facta-step-number {
    background: #4e7c2c;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
    flex-shrink: 0;
}

.facta-step-title {
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

/* Report Options */
.facta-report-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.facta-report-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.facta-report-option:hover {
    border-color: #4e7c2c;
    background: #eef7e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 124, 44, 0.15);
}

.facta-report-option.selected {
    border-color: #4e7c2c;
    background: #f0f5ee;
}

.facta-report-option input[type="radio"] {
    margin: 0 12px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.facta-report-label {
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.facta-report-label strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.facta-report-label small {
    color: #666;
    font-size: 13px;
}

/* No Reports Message */
.facta-no-reports {
    text-align: center;
    color: #999;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #e0e0e0;
}

/* Email Input */
.facta-email-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
}

.facta-email-input:focus {
    outline: none;
    border-color: #4e7c2c;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(78, 124, 44, 0.1);
}

.facta-email-input.error {
    border-color: #8D6E63;
    background: #fff5f3;
}

/* Error Message */
.facta-error-message {
    color: #8D6E63;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    animation: fadeIn 0.3s ease;
    font-weight: 500;
}

.facta-error-message.show {
    display: block;
}

/* Send Button */
.facta-send-button {
    width: 100% !important;
    padding: 14px !important;
    background: #4e7c2c !important;
    color: #ffffff !important;
    border: 1px solid black !important;
    border-radius: 10px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 10px !important;
    font-family: inherit !important;
    text-transform: uppercase !important;
}

.facta-send-button:hover:not(:disabled) {
    background: #3c6522;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(78, 124, 44, 0.4);
}

.facta-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.facta-send-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.facta-send-button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Message */
.facta-success-message {
    background: #dcedc8;
    color: #33691E;
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    display: none;
    animation: slideIn 0.5s ease;
    border: 2px solid #9CCC65;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(78, 124, 44, 0.2);
}

.facta-success-message.show {
    display: block;
}

.facta-success-message::before {
    content: "✓ ";
    font-size: 18px;
    font-weight: bold;
}

/* Error Alert */
.facta-error-alert {
    background: #d7ccc8;
    color: #3E2723;
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    display: none;
    animation: slideIn 0.5s ease;
    border: 2px solid #8D6E63;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.2);
}

.facta-error-alert.show {
    display: block;
}

.facta-error-alert::before {
    content: "✕ ";
    font-size: 18px;
    font-weight: bold;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .facta-newsletter-wrapper {
        padding: 30px 20px;
    }

    .facta-newsletter-title {
        font-size: 24px;
    }

    .facta-step-title {
        font-size: 15px;
    }

    .facta-report-option {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .facta-newsletter-container {
        padding: 20px 10px;
    }

    .facta-newsletter-wrapper {
        padding: 25px 15px;
        border-radius: 15px;
    }

    .facta-newsletter-title {
        font-size: 22px;
    }

    .facta-step-number {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    .facta-report-label strong {
        font-size: 14px;
    }

    .facta-report-label small {
        font-size: 12px;
    }
}

/* Accessibility */
.facta-report-option:focus-within {
    outline: 2px solid #4e7c2c;
    outline-offset: 2px;
}

.facta-email-input:focus-visible {
    outline: 2px solid #4e7c2c;
    outline-offset: 2px;
}

.facta-send-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .facta-newsletter-wrapper {
        background: #1e1e1e;
        color: #e0e0e0;
    }

    .facta-newsletter-title,
    .facta-step-title {
        color: #e0e0e0;
    }

    .facta-newsletter-subtitle,
    .facta-report-label small {
        color: #999;
    }

    .facta-report-option {
        background: #2a2a2a;
        border-color: #444;
    }

    .facta-report-option:hover {
        background: #333;
    }

    .facta-email-input {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }

    .facta-send-button {
        background: #76b041;
        color: #1e1e1e;
    }

    .facta-send-button:hover {
        background: #5b8e31;
        color: #ffffff;
    }
}
