/**
 * Zen Popup Styles - Elegant Minimalist Design
 * Modern, clean, and sophisticated
 */

/* CSS Variables for easy customization */
:root {
    --zenpopup-overlay-bg: rgba(0, 0, 0, 0.92);
    --zenpopup-backdrop-blur: 8px;
    --zenpopup-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --zenpopup-shadow-hover: 0 25px 80px rgba(0, 0, 0, 0.5);
    --zenpopup-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --zenpopup-border-radius: 12px;
}

/* Overlay with backdrop blur effect */
.zenpopup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--zenpopup-overlay-bg);
    backdrop-filter: blur(var(--zenpopup-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--zenpopup-backdrop-blur));
    z-index: 99999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
}

.zenpopup-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal - Elegant card design */
.zenpopup-modal {
    background-color: var(--zenpopup-bg, #ffffff);
    border-radius: var(--zenpopup-border-radius);
    padding: 48px 56px;
    max-width: 520px;
    width: 100%;
    position: relative;
    box-shadow: var(--zenpopup-shadow);
    animation: zenpopup-slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transform-origin: center;
    box-sizing: border-box;
}

@keyframes zenpopup-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button - Minimalist circle */
.zenpopup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--zenpopup-text, #000000);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: var(--zenpopup-transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border-radius: 50%;
    opacity: 0.6;
}

.zenpopup-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}

.zenpopup-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Form - Centered and clean */
.zenpopup-form {
    text-align: center;
    margin: 0;
}

/* Title - Modern typography */
.zenpopup-title {
    margin: 0 0 16px 0;
    font-size: 32px;
    font-weight: 600;
    color: var(--zenpopup-text, #000000);
    line-height: 1.3;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Subtitle - Refined text */
.zenpopup-subtitle {
    margin: 0 0 36px 0;
    font-size: 15px;
    color: var(--zenpopup-text, #000000);
    opacity: 0.65;
    line-height: 1.6;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Group - Better spacing */
.zenpopup-form-group {
    margin-bottom: 28px;
    text-align: left;
}

/* Input - Modern and clean */
.zenpopup-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    background-color: var(--zenpopup-bg, #ffffff);
    color: var(--zenpopup-text, #000000);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: var(--zenpopup-transition);
    outline: none;
    border-radius: 8px;
    letter-spacing: 0.2px;
}

.zenpopup-input:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

.zenpopup-input:focus {
    border-color: var(--zenpopup-text, #000000);
    background-color: rgba(0, 0, 0, 0.02);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.zenpopup-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-weight: 400;
}

.zenpopup-input.error {
    border-color: #e53935;
    background-color: rgba(229, 57, 53, 0.05);
}

.zenpopup-input.error:focus {
    box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.1);
}

/* Submit Button - Elegant and modern */
.zenpopup-submit {
    width: 100%;
    padding: 16px 32px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background-color: var(--zenpopup-btn, #000000);
    color: var(--zenpopup-btn-text, #ffffff);
    border: 1.5px solid var(--zenpopup-btn, #000000);
    cursor: pointer;
    transition: var(--zenpopup-transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    outline: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zenpopup-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

.zenpopup-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.zenpopup-submit:disabled {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.4);
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
}

/* Error Message - Subtle and clean */
.zenpopup-error {
    margin-top: 12px;
    padding: 12px 16px;
    background-color: rgba(229, 57, 53, 0.08);
    border-left: 3px solid #e53935;
    color: #c62828;
    font-size: 13px;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border-radius: 4px;
    line-height: 1.5;
    animation: zenpopup-shake 0.4s ease;
}

@keyframes zenpopup-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Success Message - Elegant feedback */
.zenpopup-success {
    margin-top: 12px;
    padding: 12px 16px;
    background-color: rgba(76, 175, 80, 0.08);
    border-left: 3px solid #4caf50;
    color: #2e7d32;
    font-size: 13px;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border-radius: 4px;
    line-height: 1.5;
    animation: zenpopup-fadeIn 0.3s ease;
}

/* Confirm Page Styles - Consistent design */
.zenpopup-confirm-container {
    max-width: 640px;
    margin: 60px auto;
    padding: 0 24px;
}

.zenpopup-confirm-success,
.zenpopup-confirm-error {
    text-align: center;
    padding: 56px 48px;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--zenpopup-shadow);
    border-radius: var(--zenpopup-border-radius);
}

.zenpopup-confirm-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 32px;
    border: 2px solid #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: #000000;
    line-height: 1;
    transition: var(--zenpopup-transition);
}

.zenpopup-confirm-success .zenpopup-confirm-icon {
    background-color: #000000;
    color: #ffffff;
}

.zenpopup-confirm-error .zenpopup-confirm-icon {
    background-color: #ffffff;
    color: #000000;
}

.zenpopup-confirm-success h1,
.zenpopup-confirm-error h1 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 600;
    color: #000000;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.3;
}

.zenpopup-confirm-message {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.zenpopup-confirm-message.success {
    color: #000000;
    font-weight: 500;
}

.zenpopup-discount-code {
    margin: 32px 0;
    padding: 24px 32px;
    background-color: rgba(0, 0, 0, 0.03);
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    display: inline-block;
    transition: var(--zenpopup-transition);
}

.zenpopup-discount-code:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.25);
}

.zenpopup-code-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
}

.zenpopup-code-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    letter-spacing: 4px;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.zenpopup-btn-home {
    display: inline-block;
    margin-top: 32px;
    padding: 16px 40px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background-color: #000000;
    color: #ffffff;
    border: 1.5px solid #000000;
    text-decoration: none;
    transition: var(--zenpopup-transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zenpopup-btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

.zenpopup-btn-home:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Label oculto para accesibilidad */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mejoras de accesibilidad */
.zenpopup-overlay[aria-hidden="true"] {
    display: none;
}

.zenpopup-overlay[aria-hidden="false"] {
    display: flex;
}

/* Animación de salida */
.zenpopup-overlay.closing {
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zenpopup-modal.closing {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus visible para accesibilidad */
.zenpopup-close:focus-visible,
.zenpopup-input:focus-visible,
.zenpopup-submit:focus-visible,
.zenpopup-btn-home:focus-visible {
    outline: 2px solid var(--zenpopup-text, #000000);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Responsive - Mobile first approach */
@media (max-width: 768px) {
    .zenpopup-overlay {
        padding: 16px;
    }
    
    .zenpopup-modal {
        width: 100%;
        padding: 40px 32px;
        max-width: 100%;
        border-radius: 16px;
    }
    
    .zenpopup-close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .zenpopup-title {
        font-size: 26px;
        margin-bottom: 14px;
    }
    
    .zenpopup-subtitle {
        font-size: 14px;
        margin-bottom: 32px;
    }
    
    .zenpopup-input {
        padding: 14px 18px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .zenpopup-submit {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .zenpopup-confirm-container {
        margin: 40px auto;
        padding: 0 16px;
    }
    
    .zenpopup-confirm-success,
    .zenpopup-confirm-error {
        padding: 40px 32px;
        border-radius: 16px;
    }
    
    .zenpopup-confirm-success h1,
    .zenpopup-confirm-error h1 {
        font-size: 24px;
    }
    
    .zenpopup-code-value {
        font-size: 24px;
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .zenpopup-modal {
        padding: 32px 24px;
        border-radius: 12px;
    }
    
    .zenpopup-title {
        font-size: 22px;
    }
    
    .zenpopup-subtitle {
        font-size: 13px;
    }
    
    .zenpopup-confirm-success,
    .zenpopup-confirm-error {
        padding: 32px 24px;
    }
}

/* Prefers reduced motion - Accessibility */
@media (prefers-reduced-motion: reduce) {
    .zenpopup-overlay,
    .zenpopup-modal,
    .zenpopup-close,
    .zenpopup-submit,
    .zenpopup-input,
    .zenpopup-btn-home {
        animation: none !important;
        transition: opacity 0.2s ease, transform 0.2s ease !important;
    }
    
    @keyframes zenpopup-slideUp {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

/* Dark mode support (if needed in the future) */
@media (prefers-color-scheme: dark) {
    /* Puedes agregar estilos para dark mode aquí si es necesario */
}

/* Print styles - Hide popup when printing */
@media print {
    .zenpopup-overlay {
        display: none !important;
    }
}
