/* XI5 Registration Modal — Responsive, RTL-compatible */

/* Overlay */
.xi5-reg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal */
.xi5-reg-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: xi5FadeIn 0.2s ease-out;
}

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

/* Close button */
.xi5-reg-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    z-index: 1;
}
.xi5-reg-close:hover {
    color: #333;
}
[dir="rtl"] .xi5-reg-close {
    right: auto;
    left: 14px;
}

/* Content area */
#xi5-reg-content {
    padding: 32px;
}

/* Title */
.xi5-reg-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 24px 0;
    text-align: center;
}

/* Subtitle */
.xi5-reg-subtitle {
    font-size: 14px;
    color: #667085;
    text-align: center;
    margin: -12px 0 24px 0;
    line-height: 1.5;
}

/* Form elements */
.xi5-reg-form-group {
    margin-bottom: 18px;
}

.xi5-reg-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
}
.xi5-reg-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Consent checkbox */
.xi5-reg-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
}
.xi5-reg-consent input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}
.xi5-reg-consent label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
}

/* Honeypot — hidden from humans */
.xi5-reg-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Submit button */
.xi5-reg-submit {
    width: 100%;
    padding: 14px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.xi5-reg-submit:hover {
    background: #1d4ed8;
}
.xi5-reg-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Loading spinner */
.xi5-reg-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: xi5Spin 0.6s linear infinite;
    vertical-align: middle;
    margin-inline-end: 8px;
}
@keyframes xi5Spin {
    to { transform: rotate(360deg); }
}

/* Result states */
.xi5-reg-result {
    text-align: center;
    padding: 10px 0;
}
.xi5-reg-result-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}
.xi5-reg-result-icon.success { color: #22c55e; }
.xi5-reg-result-icon.info { color: #2563eb; }
.xi5-reg-result-icon.error { color: #ef4444; }

.xi5-reg-result-message {
    font-size: 16px;
    color: #333;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

/* Action buttons in result state */
.xi5-reg-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.xi5-reg-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border: none;
    transition: all 0.2s;
}
.xi5-reg-btn-primary {
    background: #2563eb;
    color: #fff !important;
}
.xi5-reg-btn-primary:hover {
    background: #1d4ed8;
}
.xi5-reg-btn-secondary {
    background: #f1f5f9;
    color: #333 !important;
    border: 1px solid #d0d5dd;
}
.xi5-reg-btn-secondary:hover {
    background: #e2e8f0;
}

/* Default shortcode button style */
.xi5-registration-btn {
    padding: 12px 28px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.xi5-registration-btn:hover {
    background: #1d4ed8;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .xi5-reg-modal {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
    }
    .xi5-reg-overlay {
        align-items: flex-end;
        padding: 0;
    }
    #xi5-reg-content {
        padding: 24px 20px;
    }
}
