/**
 * Modal & Form Styles - Relatoria Autenticacion Plugin
 */

/* Overlay Container */
.rel-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, visibility;
    transform: translateZ(0);
}

.rel-auth-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Card */
.rel-auth-modal {
    background: #ffffff;
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px) translateZ(0);
    will-change: transform;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}


.rel-auth-overlay.is-active .rel-auth-modal {
    transform: scale(1) translateY(0);
}

/* Close Button (Posicionado limpiamente a la derecha) */
.rel-auth-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
}

.rel-auth-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* Header Tabs */
.rel-auth-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 4rem 0 1.5rem; /* Margen a la derecha de 4rem para dar espacio al botón X */
}

.rel-auth-tabs {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rel-auth-tab {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    padding-bottom: 0.85rem;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.rel-auth-tab:hover {
    color: #0F3A85;
}

.rel-auth-tab.is-active {
    color: #0F3A85;
    border-bottom-color: #0F3A85;
}

/* Body Container */
.rel-auth-body {
    padding: 1.75rem 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.rel-auth-pane {
    display: none;
}

.rel-auth-pane.is-active {
    display: block;
    animation: relFadeIn 0.3s ease;
}

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

/* Estilos de Alertas de Error y Éxito */
.rel-auth-alert {
    display: none;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.rel-auth-alert.rel-alert-error,
.rel-auth-alert.is-error {
    display: block !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fca5a5 !important;
    color: #991b1b !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.rel-auth-alert.rel-alert-success,
.rel-auth-alert.is-success {
    display: block !important;
    background-color: #f0fdf4 !important;
    border: 1px solid #86efac !important;
    color: #166534 !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Form Elements & Grid Uniformity */
.rel-form-group {
    margin-bottom: 1.2rem;
}

.rel-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media screen and (max-width: 576px) {
    .rel-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.rel-form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
    min-height: 22px; /* Altura idéntica para asegurar nivelado horizontal */
}

.rel-form-label .req {
    color: #dc2626;
    margin-left: 2px;
}

/* Controles con Altura y Dimensiones Exactamente Uniformes (44px) */
.rel-form-input,
.rel-form-select {
    display: block;
    width: 100%;
    height: 44px !important;
    line-height: 44px;
    padding: 0 0.9rem;
    font-size: 0.9rem;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rel-form-select {
    padding-right: 2rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.rel-form-input:focus,
.rel-form-select:focus {
    outline: none;
    border-color: #0F3A85;
    box-shadow: 0 0 0 3px rgba(15, 58, 133, 0.15);
}

.rel-form-input.is-invalid {
    border-color: #ef4444;
}

.rel-form-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.3rem;
    display: block;
}

/* Checkbox Terms */
.rel-form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.rel-form-checkbox input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    accent-color: #0F3A85;
}

/* Password Strength Meter */
.rel-pwd-meter-container {
    margin-top: 0.4rem;
}

.rel-pwd-meter-bar {
    height: 5px;
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.rel-pwd-meter-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.rel-pwd-text {
    font-size: 0.75rem;
    font-weight: 600;
}

.rel-pwd-weak { background-color: #ef4444; width: 33.3%; color: #ef4444; }
.rel-pwd-medium { background-color: #f59e0b; width: 66.6%; color: #d97706; }
.rel-pwd-strong { background-color: #10b981; width: 100%; color: #059669; }

/* Alert Boxes */
.rel-auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: none;
}

.rel-auth-alert.is-error {
    display: block;
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.rel-auth-alert.is-success {
    display: block;
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Submit Button */
.rel-auth-submit {
    width: 100%;
    height: 46px;
    padding: 0 1.5rem;
    background-color: #0F3A85;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.rel-auth-submit:hover {
    background-color: #0B2B64;
}

.rel-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Honeypot Invisible Field */
.rel-hp-field {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}
