/**
 * Estilos para la sección de Verifactu
 * Diseño minimalista inspirado en OpenAI
 */

/* ========================================
   CONTENEDOR PRINCIPAL
======================================== */
#verifactu .verifactu-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

/* ========================================
   ESTADO GENERAL
======================================== */
.verifactu-status-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.verifactu-status-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.verifactu-status-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.verifactu-status-icon.status-active {
    background: rgba(16, 185, 129, 0.2);
}

.verifactu-status-icon.status-inactive {
    background: rgba(239, 68, 68, 0.2);
}

.verifactu-status-text h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.verifactu-status-text p {
    margin: 4px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* ========================================
   TARJETAS DE CONFIGURACIÓN
======================================== */
.verifactu-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.verifactu-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.verifactu-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.verifactu-card-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.verifactu-card-icon {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ========================================
   TOGGLE SWITCH
======================================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   RADIO BUTTONS (ENTORNO)
======================================== */
.radio-group {
    display: flex;
    gap: 12px;
}

.radio-option {
    flex: 1;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    color: #6b7280;
    background: #fafafa;
}

.radio-option input[type="radio"]:checked + .radio-label {
    border-color: #667eea;
    background: #f5f7ff;
    color: #667eea;
}

.radio-label:hover {
    border-color: #9ca3af;
}

/* ========================================
   CERTIFICADO
======================================== */
.cert-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.cert-status-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid #e5e7eb;
}

.cert-status-icon.cert-active {
    border-color: #10b981;
    background: #f0fdf4;
}

.cert-status-icon.cert-missing {
    border-color: #f59e0b;
    background: #fffbeb;
}

.cert-status-info {
    flex: 1;
}

.cert-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin-bottom: 4px;
}

.cert-detail {
    font-size: 13px;
    color: #6b7280;
}

/* ========================================
   BOTONES
======================================== */
.verifactu-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.verifactu-btn-primary {
    background: #667eea;
    color: white;
}

.verifactu-btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.verifactu-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.verifactu-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.verifactu-btn-danger {
    background: white;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.verifactu-btn-danger:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #ef4444;
}

.verifactu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.verifactu-btn-group {
    display: flex;
    gap: 8px;
}

/* ========================================
   INFORMACIÓN DEL SISTEMA
======================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
}

.info-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* ========================================
   MODAL
======================================== */
#modal-certificado {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

#modal-certificado .modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#modal-certificado .modal-header {
    padding: 24px 24px 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f3f4f6;
}

#modal-certificado .modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

#modal-certificado .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

#modal-certificado .modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

#modal-certificado .modal-body {
    padding: 24px;
}

#modal-certificado .form-group {
    margin-bottom: 20px;
}

#modal-certificado .form-group:last-child {
    margin-bottom: 0;
}

#modal-certificado .form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

#modal-certificado .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

#modal-certificado .form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#modal-certificado .form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

#modal-certificado .modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.upload-progress {
    margin-top: 12px;
    padding: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
    font-size: 13px;
    text-align: center;
}

/* ========================================
   LOADING
======================================== */
.verifactu-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.verifactu-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.verifactu-loading-text {
    margin-top: 16px;
    color: #6b7280;
    font-size: 14px;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    #verifactu .verifactu-container {
        padding: 16px;
    }

    .verifactu-status-card {
        padding: 24px;
    }

    .verifactu-card {
        padding: 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }

    .verifactu-btn-group {
        flex-direction: column;
    }

    .verifactu-btn {
        width: 100%;
        justify-content: center;
    }
}

