/**
 * Brizy Newsletter Popup - Frontend Styles
 * Designed to match Brizyproducts.com aesthetic
 */

/* CSS Variables - Brizy Products Brand */
:root {
    --pwl-popup-primary: #F5C518;
    --pwl-popup-primary-hover: #E5B508;
    --pwl-popup-dark: #1a1a1a;
    --pwl-popup-darker: #0d0d0d;
    --pwl-popup-light: #ffffff;
    --pwl-popup-gray: #6b6b6b;
    --pwl-popup-gray-light: #a0a0a0;
    --pwl-popup-border: rgba(255, 255, 255, 0.1);
    --pwl-popup-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --pwl-popup-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --pwl-popup-radius: 16px;
    --pwl-popup-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Popup Container */
.pwl-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--pwl-popup-font);
    visibility: hidden;
    pointer-events: none;
}

.pwl-popup[aria-hidden="false"] {
    visibility: visible;
    pointer-events: auto;
}

/* Overlay */
.pwl-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background var(--pwl-popup-transition), backdrop-filter var(--pwl-popup-transition);
}

.pwl-popup[aria-hidden="false"] .pwl-popup-overlay {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Popup Container Box */
.pwl-popup-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: var(--pwl-popup-shadow);
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity var(--pwl-popup-transition), transform var(--pwl-popup-transition);
    padding-top: 30px;
}

.pwl-popup[aria-hidden="false"] .pwl-popup-container {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Close Button */
.pwl-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--pwl-popup-gray);
    cursor: pointer;
    transition: all var(--pwl-popup-transition);
}

.pwl-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--pwl-popup-dark);
}

.pwl-popup-close:focus,
.pwl-popup-close:active {
    outline: none;
    box-shadow: none;
}

.pwl-popup-close svg {
    width: 14px;
    height: 14px;
}

/* Header */
.pwl-popup-header {
    padding: 0;
    text-align: left;
    max-width: 390px;
    margin: 0 auto;
}

.pwl-popup-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--pwl-popup-dark);
    letter-spacing: -0.02em;
}

.pwl-popup-description {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--pwl-popup-gray);
}

/* Content Area - Brevo Form Container */
.pwl-popup-content {
    padding: 0;
    margin-bottom: 50px;
}

/* Style overrides for Brevo forms */
.pwl-popup-content form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwl-popup-content input[type="text"],
.pwl-popup-content input[type="email"],
.pwl-popup-content input[type="tel"],
.pwl-popup-content select,
.pwl-popup-content textarea {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--pwl-popup-font);
    font-size: 16px;
    color: var(--pwl-popup-dark);
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: border-color var(--pwl-popup-transition), box-shadow var(--pwl-popup-transition);
    box-sizing: border-box;
}

.pwl-popup-content input[type="text"]::placeholder,
.pwl-popup-content input[type="email"]::placeholder,
.pwl-popup-content input[type="tel"]::placeholder,
.pwl-popup-content textarea::placeholder {
    color: var(--pwl-popup-gray-light);
}

.pwl-popup-content input[type="text"]:focus,
.pwl-popup-content input[type="email"]:focus,
.pwl-popup-content input[type="tel"]:focus,
.pwl-popup-content select:focus,
.pwl-popup-content textarea:focus {
    outline: none;
    border-color: var(--pwl-popup-primary);
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

/* Labels */
.pwl-popup-content label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pwl-popup-dark);
}

/* Submit Button - Brizy Yellow Style */
.pwl-popup-content input[type="submit"],
.pwl-popup-content button[type="submit"],
.pwl-popup-content .sib-form-block__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 32px;
    font-family: var(--pwl-popup-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--pwl-popup-dark);
    background: var(--pwl-popup-primary);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all var(--pwl-popup-transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pwl-popup-content input[type="submit"]:hover,
.pwl-popup-content button[type="submit"]:hover,
.pwl-popup-content .sib-form-block__button:hover {
    background: var(--pwl-popup-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 197, 24, 0.3);
}

.pwl-popup-content input[type="submit"]:focus,
.pwl-popup-content button[type="submit"]:focus,
.pwl-popup-content .sib-form-block__button:focus {
    outline: 2px solid var(--pwl-popup-light);
    outline-offset: 2px;
}

.pwl-popup-content input[type="submit"]:active,
.pwl-popup-content button[type="submit"]:active,
.pwl-popup-content .sib-form-block__button:active {
    transform: translateY(0);
}

/* Checkbox styling */
.pwl-popup-content input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    accent-color: var(--pwl-popup-primary);
    cursor: pointer;
}

.pwl-popup-content input[type="checkbox"] + label,
.pwl-popup-content label:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.4;
    color: var(--pwl-popup-gray);
    cursor: pointer;
}

/* Radio buttons */
.pwl-popup-content input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: var(--pwl-popup-primary);
    cursor: pointer;
}

/* Error messages */
.pwl-popup-content .sib-form-message-panel,
.pwl-popup-content .entry__error {
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 14px;
    border-radius: 8px;
}

.pwl-popup-content .sib-form-message-panel--active.sib-form-message-panel--error,
.pwl-popup-content .entry__error--primary {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.pwl-popup-content .sib-form-message-panel--active.sib-form-message-panel--success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

/* Hide Brevo branding if present */
.pwl-popup-content .sib-form__declaration,
.pwl-popup-content [class*="brevo-logo"],
.pwl-popup-content [class*="sendinblue"] {
    display: none !important;
}

/* Hide scrollbar for popup */
.pwl-popup-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.pwl-popup-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Animations */
@keyframes pwl-popup-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.pwl-popup-content .entry__field--invalid input {
    animation: pwl-popup-shake 0.4s ease-in-out;
    border-color: #dc3545 !important;
}

/* Responsive Design */
@media (max-width: 600px) {
    .pwl-popup {
        padding: 0;
    }
    
    .pwl-popup-container {
        max-width: 100%;
        border-radius: 0;
    }
    
    .pwl-popup-header {
        padding: 0;
    }
    
    .pwl-popup-title {
        font-size: 24px;
    }
    
    .pwl-popup-description {
        font-size: 15px;
    }
    
    .pwl-popup-content {
        padding: 0;
    }
    
    .pwl-popup-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
    
    .pwl-popup-close svg {
        width: 18px;
        height: 18px;
    }
}

/* Print styles - hide popup */
@media print {
    .pwl-popup {
        display: none !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pwl-popup-overlay,
    .pwl-popup-container,
    .pwl-popup-close,
    .pwl-popup-content input,
    .pwl-popup-content button {
        transition: none;
    }
    
    .pwl-popup-content .entry__field--invalid input {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pwl-popup-container {
        border: 2px solid #000;
    }
    
    .pwl-popup-content input[type="text"],
    .pwl-popup-content input[type="email"],
    .pwl-popup-content input[type="tel"],
    .pwl-popup-content select,
    .pwl-popup-content textarea {
        border-width: 2px;
    }
}

/* Focus visible for keyboard navigation */
.pwl-popup *:focus-visible {
    outline: 2px solid var(--pwl-popup-primary);
    outline-offset: 2px;
}

