/**
 * Xiiar Flyer Frontend Styles
 * Modern, premium UI for lead capture forms
 */

/* Modal Overlay with Blur */
.xiiar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: xiiarFadeIn 0.3s ease;
}

/* Modal Content Card */
.xiiar-modal-content {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2.5rem 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: xiiarSlideUp 0.3s ease;
}

/* Close Button */
.xiiar-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.xiiar-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Headers */
.xiiar-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.xiiar-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.xiiar-form-desc {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Form Groups */
.xiiar-form-group {
    margin-bottom: 1.25rem;
}

.xiiar-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.xiiar-required-star {
    color: #ef4444;
    margin-left: 2px;
}

/* Inputs */
.xiiar-form-input,
.xiiar-form-select,
.xiiar-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1f2937;
    background: #f9fafb;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

/* Specific Tweak for Phone Input: monospace font for better number alignment */
input[type="tel"].xiiar-form-input {
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 1px;
}

.xiiar-form-input:focus,
.xiiar-form-select:focus,
.xiiar-form-textarea:focus {
    outline: none;
    background: #fff;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.xiiar-form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio & Checkbox */
.xiiar-check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.xiiar-check-label {
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.95rem;
    color: #374151;
}

.xiiar-check-input {
    margin-right: 0.35rem;
    accent-color: #a855f7;
    width: 1.1em;
    height: 1.1em;
}

/* Submit Button */
.xiiar-submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(147, 51, 234, 0.3);
}

.xiiar-submit-btn:hover {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    box-shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.4);
}

.xiiar-submit-btn:active {
    transform: scale(0.98);
}

.xiiar-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Footer Note */
.xiiar-form-footer {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Animation Keyframes */
@keyframes xiiarFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes xiiarSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Mode Theme */
.xiiar-theme-dark .xiiar-modal-content,
.xiiar-theme-dark.xiiar-lead-form-container {
    background: #1f2937;
    color: #f3f4f6;
    border: 1px solid #374151;
}

.xiiar-theme-dark .xiiar-modal-close {
    background: #374151;
    color: #9ca3af;
}

.xiiar-theme-dark .xiiar-modal-close:hover {
    background: #4b5563;
    color: #fff;
}

.xiiar-theme-dark .xiiar-form-title {
    color: #f9fafb;
}

.xiiar-theme-dark .xiiar-form-desc {
    color: #9ca3af;
}

.xiiar-theme-dark .xiiar-form-label {
    color: #e5e7eb;
}

.xiiar-theme-dark .xiiar-form-input,
.xiiar-theme-dark .xiiar-form-select,
.xiiar-theme-dark .xiiar-form-textarea {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.xiiar-theme-dark .xiiar-form-input:focus,
.xiiar-theme-dark .xiiar-form-select:focus,
.xiiar-theme-dark .xiiar-form-textarea:focus {
    border-color: #c084fc;
    background: #000;
}

.xiiar-theme-dark .xiiar-check-label {
    color: #e5e7eb;
}

/* Mobile Tweaks */
@media (max-width: 640px) {
    .xiiar-modal-content {
        padding: 2rem 1.5rem;
    }
}